1 2 3 Previous Next 33 Replies Latest reply on Oct 21, 2016 8:51 AM by franz84rn

    Jboss monitoring - No 'jboss' MBeanServer found!

    manishdevraj

      We are trying to configure Jboss monitoring using Nagios Plugin. We have installed Nagios server nagios-3.4.4 and plugin nagios-plugins-1.4.16. Jboss AS 7.1.1 configured Mbean server (SAR) to accept request at 5566 using MXbean.

       

      When we try to run following command we are recieving follwing error.

       

      $ sudo ./check_mbean_collector -H 10.0.11.232 -p 5566 -m jboss.system:type=ServerInfo -a ActiveThreadCount -w 200 -c 400

       

      UNKNOWN ? UNKNOWN - MBeanServer responded: IllegalStateException No 'jboss' MBeanServer found!

       

      It is throwing error at MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();

       

      I researched about issue and issue might occur if this call is made outside Jboss JVM, which is not the case currently as we are running collector.SAR on Jboss.

       

       

      Any thoughts?

        • 1. Re: Jboss monitoring - No 'jboss' MBeanServer found!
          manishdevraj

          Above problem is dueto locateJboss implementation that is compatible with older version of Jboss. The MBeanServer used by JBoss 7 (by default) is the platform MBeanServer. The class name iscom.sun.jmx.mbeanserver.JmxMBeanServer and the default domain is DefaultDomain. Accordingly, you can simply use: 

           

          java.lang.management.ManagementFactory.getPlatformMBeanServer()

           

          Alternatively:

           

               for(MBeanServer server: javax.management.MBeanServerFactory.findMBeanServer(null)) {

                    if("DefaultDomain".equals(server.getDefaultDomain())) return server;

               }

               throw new Exception("Failed to locate MBeanServer");

           

          On another note, jboss.system:type=ServerInfo object name doesn't work in AS 7.1 I had to use JVM specifi parameters to nail down to MBean attributes. 'java.lang:type=Memory' and attribute as 'HeapMemoryUsage'

          • 2. Re: Jboss monitoring - No 'jboss' MBeanServer found!
            manishdevraj

            For those looking for monitoring Mbean compatible with AS 7.1.1, I have pushed code to calculate Heapusage and prepared SAR to notify it to Nagios plugin. https://github.com/manishdevraj/jboss2nagios

            • 3. Re: Jboss monitoring - No 'jboss' MBeanServer found!
              sebyfrancis

              Manish,

               

              Thank you for the new file. I'm trying to monitor jboss AS7 using nagios and failed. I've also tried the new sar file which showed me the below errors. Can you help me to find out the reason?

               

               

              02:46:42,213 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "collector.sar"

              02:46:42,235 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."collector.sar".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."collector.sar".STRUCTURE: Failed to process phase STRUCTURE of deployment "collector.sar"

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

                        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

              Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content

                        at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                        ... 5 more

              Caused by: java.util.zip.ZipException: error in opening zip file

                        at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.7.0_13]

                        at java.util.zip.ZipFile.<init>(ZipFile.java:214) [rt.jar:1.7.0_13]

                        at java.util.zip.ZipFile.<init>(ZipFile.java:144) [rt.jar:1.7.0_13]

                        at java.util.jar.JarFile.<init>(JarFile.java:153) [rt.jar:1.7.0_13]

                        at java.util.jar.JarFile.<init>(JarFile.java:117) [rt.jar:1.7.0_13]

                        at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:97)

                        at org.jboss.vfs.spi.JavaZipFileSystem.<init>(JavaZipFileSystem.java:83)

                        at org.jboss.vfs.VFS.mountZip(VFS.java:408)

                        at org.jboss.vfs.VFS.mountZip(VFS.java:434)

                        at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:95) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                        at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:87) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                        ... 6 more

               

              Details:

              [jboss7@dev20 ~]$ cksum collector.sar

              857350315 20076 collector.sar

              [jboss7@dev20 ~]$

               

              OS: CentOS release 6.3 (Final)

              AS7: jboss-as-7.1.1.Final

               

               

              Best,

              SFK

              • 4. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                nickarls

                Can you open the sar file with a normal unzip program?

                • 5. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                  manishdevraj

                  Looks like SAR got corrupt when you downloaded. I re-downloaded it from GIT and I was able to open up in unzip. Confirm if you are able to open it? Also make sure you add dependency https://github.com/manishdevraj/jboss2nagios/blob/master/module.xml module.

                  • 6. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                    sebyfrancis

                    Nope:

                     

                    unzip collector.sar

                    Archive:  collector.sar

                      End-of-central-directory signature not found.  Either this file is not

                      a zipfile, or it constitutes one disk of a multi-part archive.  In the

                      latter case the central directory and zipfile comment will be found on

                      the last disk(s) of this archive.

                    unzip:  cannot find zipfile directory in one of collector.sar or

                            collector.sar.zip, and cannot find collector.sar.ZIP, period.

                    • 7. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                      manishdevraj

                      This is the ouput for me

                       

                      $ unzip collector.sar

                      Archive:  collector.sar

                         creating: META-INF/

                        inflating: META-INF/MANIFEST.MF

                         creating: jboss/

                         creating: jboss/monitoring/

                         creating: jboss/monitoring/util/

                        inflating: META-INF/jboss-service.xml

                        inflating: jboss/monitoring/Collector.class

                        inflating: jboss/monitoring/CollectorAcceptingThread.class

                        inflating: jboss/monitoring/CollectorMBean.class

                        inflating: jboss/monitoring/CollectorRequestHandlingThread.class

                        inflating: jboss/monitoring/MyServerMonitor.class

                        inflating: jboss/monitoring/MyServerMonitorMBean.class

                        inflating: jboss/monitoring/util/MBeanServerLocatorEx.class

                        inflating: jboss/monitoring/util/MXBeanConstants.class

                        inflating: jboss/monitoring/util/MXBeanReader.class

                        inflating: jboss/monitoring/util/NagiosRange.class

                      • 8. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                        sebyfrancis

                        Hi Manish,

                         

                        I got the correct file now.

                         

                        [jboss7@dev20 ~]$ cksum collector.sar

                        363850209 12218 collector.sar

                        [jboss7@dev20 ~]$

                         

                        Do I also need to add the jar file "jboss-common.jar" in to the deployment directory?

                         

                        Regards,
                        Seby.

                        • 9. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                          sebyfrancis

                          Manish,

                           

                          From what I see with the existing installation, I've to copy the jboss-common.jar and module.xml files to "<JBAS7>/modules/com/jboss/jboss2nagios/". Let me try it out and will update you.

                           

                          Regards,

                          Seby.

                          • 10. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                            sebyfrancis

                            This is what I see now:

                             

                            04:13:58,383 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "collector.sar"

                            04:13:58,560 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.module.service."deployment.collector.sar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.collector.sar".main: Failed to load module: deployment.collector.sar:main

                                      at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

                                      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

                            Caused by: org.jboss.modules.ModuleNotFoundException: Module com.icare.jboss2nagios:main is not found in local module loader @2ac28d29 (roots: /home/jboss7/jboss-as-7.1.1.Final/modules)

                                      at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.Module.addPaths(Module.java:841) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.Module.link(Module.java:1181) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208) [jboss-modules.jar:1.1.1.GA]

                                      at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                      ... 5 more

                            • 11. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                              sebyfrancis

                              Manesh,

                               

                              Can you please let me know the reason why it fails to deploy?

                               

                              Regards,

                              SFK.

                              • 12. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                                manishdevraj

                                Take latest SAR it is built with dependency com.jboss.jboss2nagios module dependency. Also make your that you add package dependency "org.jboss.util.StringPropertyReplacer" in your standalone.xml once you create module. Restart JBOSS and you should be good.

                                • 13. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                                  sebyfrancis

                                  I'll try it now and will get back to you.

                                   

                                  Thanks,

                                  SFK.

                                  • 14. Re: Jboss monitoring - No 'jboss' MBeanServer found!
                                    sebyfrancis

                                    Manish,

                                     

                                    Her are my files:

                                    [jboss7@dev20 jboss2nagios]$ pwd

                                    /home/jboss7/jboss-as-7.1.1.Final/modules/com/jboss/jboss2nagios

                                    [jboss7@dev20 jboss2nagios]$ ls -rlt

                                    total 404

                                    -rw-rw-r-- 1 jboss7 jboss7 406564 Mar 15 03:22 jboss-common.jar

                                    -rw-rw-r-- 1 jboss7 jboss7   1231 Mar 15 03:22 module.xml

                                    [jboss7@dev20 jboss2nagios]$ tail module.xml

                                      ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

                                      ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.

                                      -->

                                     

                                     

                                    <module xmlns="urn:jboss:module:1.0" name="com.jboss.jboss2nagios" >

                                        <resources>

                                      <resource-root path="jboss-common.jar"/>

                                        </resources>

                                        <dependencies/>

                                    </module>

                                    [jboss7@dev20 jboss2nagios]$

                                     

                                     

                                     

                                     

                                    Added the StringPropertryReplacer to the standalone.xml file

                                     

                                     

                                    [jboss7@dev20 configuration]$ pwd

                                    /home/jboss7/jboss-as-7.1.1.Final/standalone/configuration

                                    [jboss7@dev20 configuration]$ head standalone.xml

                                    <?xml version='1.0' encoding='UTF-8'?>

                                     

                                     

                                    <server xmlns="urn:jboss:domain:1.2">

                                     

                                     

                                        <extensions>

                                            <extension module="org.jboss.util.StringPropertyReplacer"/>

                                            <extension module="org.jboss.as.clustering.infinispan"/>

                                            <extension module="org.jboss.as.configadmin"/>

                                            <extension module="org.jboss.as.connector"/>

                                            <extension module="org.jboss.as.deployment-scanner"/>

                                    [jboss7@dev20 configuration]$ pwd

                                    /home/jboss7/jboss-as-7.1.1.Final/standalone/configuration

                                    [jboss7@dev20 configuration]$

                                     

                                     

                                    Noticed the Jboss is not starting at all. Nothing logged in server.log. I then reverted the standalone.xml and can see the Jboss started, but logged the below error messages:

                                     

                                     

                                    05:45:26,438 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "collector.sar"

                                    05:45:26,438 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "jndi-view-0.2.war"

                                    05:45:26,617 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.module.service."deployment.collector.sar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.collector.sar".main: Failed to load module: deployment.collector.sar:main

                                            at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                                            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

                                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

                                            at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

                                    Caused by: org.jboss.modules.ModuleNotFoundException: Module com.jboss.jboss2nagios:main is not found in local module loader @4ac194ad (roots: /home/jboss7/jboss-as-7.1.1.Final/modules)

                                            at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.Module.addPaths(Module.java:841) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.Module.link(Module.java:1181) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208) [jboss-modules.jar:1.1.1.GA]

                                            at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                            ... 5 more

                                     

                                     

                                     

                                     

                                     

                                     

                                    SFK.

                                    1 2 3 Previous Next