Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

toimtoimtoim

Reviews(1)
bytoimtoimtoim, November 27, 2012
1 of 1 people found this review helpful
If you need perf data for your nagios then you could use this script. I have combined other things mentioned in past reviews and added little sed magic to format perf data in correct way.

Atleast for "check_jmx -U service:jmx:rmi:///jndi/rmi://localhost:8060/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -I HeapMemoryUsage -J used -vvvv -w 4248302272 -c 5498760192"

output seems to be ok
"JMX OK HeapMemoryUsage.used=70437104{committed=202899456;init=209715200;max=608174080;used=70437104} | committed=202899456; init=209715200; max=608174080; used=70437104;"


#!/bin/sh
JAVA_CMD=`which java`
if [ -z $JAVA_CMD ]
then
if [ -x $JAVA_HOME/bin/java ]
then
JAVA_CMD=$JAVA_HOME/bin/java
else
echo JMX CRITICAL - java not found.
exit 2
fi
fi

RDIR=`dirname $0`
OUTPUT=$($JAVA_CMD -cp $RDIR/jmxquery.jar org.nagios.JMXQuery $@)
EXIT_STATUS=$?
STATUS=`echo $OUTPUT`
VALUE=$(echo $OUTPUT | sed 's/.*{\(.*\)}.*/\1;/' | sed 's/;/; /g')
echo "$STATUS | $VALUE"

exit $EXIT_STATUS