8 Replies Latest reply on Jun 8, 2010 10:23 AM by ssroy73

    Storing monitoring informations in database

    ssroy73

      Hi,

       

      We are using Jboss AS in our project. Currently we are viewing graphs for 'currentThreadsBusy/currentThreadCount' from 'jboss.web:type=ThreadPool..' of JMX MBeans.

       

      Now a requirement has come up to store these informations in Oracle database and report has to be generated out of the stored informations in dashboard fashion.

       

      Can anyone please let me know if there is any way to achieve this by adding any MBean or may be adding any attributes to the existing MBean.

       

      Your input will be greatly appreciated.

       

      Many Thanks.

       

       

      Best Regards,

       

      Roy

        • 1. Re: Storing monitoring informations in database
          peterj

          Roy, welcome to the forum!

           

          There is nothing that does this automatically, but you should be able to write it easily yourself. You could either wrtie a script that uses twiddle to access the data you want, and have the script put the data in Oracle, and then run the script on a timer. Or you can write a simple Java app to access the mbean and store the results in Oracle; out the code in a loop with a wait time.

          • 2. Re: Storing monitoring informations in database
            ssroy73

            Thanks a lot Peter for the response.

             

            Is there any tool/script readily available which can be used to generate static graph from the informations stored in database.

             

            Thanks a lot again.

             

             

            Best Regards,

             

            Roy

            • 3. Re: Storing monitoring informations in database
              ssroy73

              Hi Peter,

               

              I was searching some documentation around your suggestion to access MBean from java code but of no avail. Can you please point me some documentation around this.

               

              Thanks a lot.

               

              Best Regards,

               

              Roy

              • 4. Re: Storing monitoring informations in database
                dimitris

                Why not setting up Jopr?

                • 6. Re: Storing monitoring informations in database
                  ssroy73

                  Thanks a lot Peter. I really appreciate your help. These links are very useful.

                   

                  I could run my client successfully under windows environment.

                   

                  But while running the same client in Linux I am getting javax.management.InstanceNotFoundException.

                   

                  I am getting the above exception from following code snippet

                   

                  ObjectName objName = new ObjectName("jboss.web:type=ThreadPool,name=ajp-<Domain Name>%2F<IP>-<port>"); //Error is coming here - copy and pasted the object name from web-console

                   

                  Object obj = null;

                   

                  while(true) {

                     obj = server.getAttribute(objName, "currentThreadsBusy");

                     System.out.println(obj);

                     Thread.sleep(1000);

                  }

                   

                   

                  I copied the object name after hitting the browser with "http://IP:8080/web-console. Same works in windows.

                   

                  But instead of the above object name if I use "java.web:type=Host,host=localhost" and print its attribute, it gives me output.

                   

                   

                  I am not sure what I am missing.

                   

                  I will really appreciate your input on this.

                   

                  Thanks and Best Regards,

                   

                  Roy

                  • 7. Re: Storing monitoring informations in database
                    peterj

                    You lost me - you are mentioning both Windows and Linux, yet not saying which one you got the data from when it failed in Linux. Your best bet is to use jmx-console again the Jboss AS runnign on Linux and getting the MBean name from that. Also, try it out with twiddle first to verify the name.

                     

                    Finally, what JDK are you using on Linux?

                    • 8. Re: Storing monitoring informations in database
                      ssroy73

                      Hi Peter,

                       

                      Sorry for creating confusion.

                       

                      I was getting "currentThreadsBusy" value while running Jboss in Windows but not in Linux.

                       

                      Anyway, I could figure out the problem. We have Apache infront of JBoss in Linux (Apache and Jboss are installed in 2 different box). I directly used the IP of Jboss machine while accessing web-console yesterday and picked up the object name. But today when I accessed the web-console via web server, I could see a different object name. Not sure why though!!. But my client program is running successfully now in Linux as well.

                       

                      Thanks a lot once again for all your help.

                       

                      Best Regards,

                       

                      Roy