Nagios JBoss Check
![](https://i0.wp.com/lefred.be/wp-content/uploads/2016/05/IMG_6573.jpg?fit=768%2C576&ssl=1)
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