Nagios JBoss Check

As I had to monitor some JBoss servers and as there are some memory leaks in the program, the monitoring in Nagios of the Garbage Collector is very important. I've found some jmx script on JBoss wiki, but I was not happy with it. So I rewrite it to use twiddle.sh with the attributes I needed. I had also to modify twiddle.sh to remove the logging capability (that was causing permission error) : # diff twiddle.sh twiddleFred.sh 58c58 < JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/log4j.jar" --- > # removed to avoid log file JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/log4j.jar" Those are the nrpe test I implemented : # check Perm Gen command[check_jbosspem]=/usr/lib/nagios/plugins/check_jbosspem 127.0.0.1 4 jboss.system:type=ServerInfo listMemoryPools "Perm Gen" 70 90 # check Old Gen (Heap Memory) command[check_jbossoldgen]=/usr/lib/nagios/plugins/check_jbosspem 127.0.0.1 4 jboss.system:type=ServerInfo listMemoryPools "Old Gen" 85 95

As I had to monitor some JBoss servers and as there are some memory leaks in the program, the monitoring in Nagios of the Garbage Collector is very important. I’ve found some jmx script on JBoss wiki, but I was not happy with it. So I rewrite it to use twiddle.sh with the attributes I needed.

I had also to modify twiddle.sh to remove the logging capability (that was causing permission error) :

# diff twiddle.sh twiddleFred.sh
58c58
< JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
---
> # removed to avoid log file JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_HOME/client/log4j.jar"

Those are the nrpe test I implemented :

# check Perm Gen
command[check_jbosspem]=/usr/lib/nagios/plugins/check_jbosspem 127.0.0.1 4 jboss.system:type=ServerInfo listMemoryPools "Perm Gen" 70 90

# check Old Gen (Heap Memory)
command[check_jbossoldgen]=/usr/lib/nagios/plugins/check_jbosspem 127.0.0.1 4 jboss.system:type=ServerInfo listMemoryPools "Old Gen" 85 95

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

8 Comments

  1. this is exactly what i’m looking for. it would be nice if you share your knowledge with me 🙂

    • Hi,

      I have 4 jboss5 servers installed in my server with diferrent directory location with different port.

      1. If i deploy this collector.sar file in first jboss it will open 5566 port.
      I can able to monitor that jboss in nagios.

      2. If i want monitor 2,3 & 4 th jbosses also i cant keep same collector.sar file in those jboss deployment directories because 5566 port allready in use in 1st jboss.

      Please help me any one how can resolve this issue.

      Help is request ASAP.

      For more details / quires /help write to mail on ds.rhct@gmail.com

      Regards,
      Suresh,
      ds.rhct@gmail.com,
      Andhra Pradesh,
      India.

      • Hi Andhra,

        I’m not familiar with the tool of Tobias, but what you can try is to unzip collector.jar, and modify in META-INF/jboss-service.xml the port 5566.

        But I also advise you to ask directly on jboss2nagios support page on sf.net or on their mailing list.

        Cheers,

        Fred.

        • Hi Fred,

          Thanx for your replay.

          Do u have any idea about .sar files.

          Because this nagios collecor is .sar file and can have idea about editing this .sar files.

          It will help me alot.

          Regards,
          suresh

  2. Hello,

    Thanks for article,
    Can somebody tell me, how i can run this script in windows jboss server

    Thanks

    Mohammed Khalid

Leave a Reply to Mohammed KhalidCancel Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.