You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is an improved version of check_jmx bash script, one that will detect
JAVA_HOME and that fails nicely when JAVA is missing.
#!/bin/sh
#
# Nagios plugin to monitor Java JMX (http://java.sun.com/jmx)attributes.
#
#RDIR=`dirname $0`
#java -cp $RDIR/jmxquery.jar org.nagios.JMXQuery $@
#!/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 -jar $RDIR/jmxquery.jar $@)
EXIT_STATUS=$?
STATUS=`echo $OUTPUT`
VALUE=$(echo $OUTPUT | sed 's/.*{\(.*\)}.*/\1;/' | sed 's/;/; /g')
echo "$STATUS | $VALUE"
exit $EXIT_STATUS.
Original issue reported on code.google.com by [email protected] on 10 Dec 2013 at 11:55
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 10 Dec 2013 at 11:55The text was updated successfully, but these errors were encountered: