Good evening. I am just starting to learn nagios and here is what I am having problems now. Hope someone could help me.
I am having problems with this script that I am using. I am trying to use rawNumbers.php on nagvis, but nagvis gives me an Error state.
I tried to read and search for answers, but it is true that in order for rawNumbers.php to work is to have the service collecting perfdata? Or is there any other way I can be able to display the output properly in nagvis.
Below is the scrip that I am using:
Code: Select all
#!/bin/bash
# Return codes:
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
# Arguments:
WARNLEVEL=$1
CRITLEVEL=$2
STATS=$(/opt/ardome/bin/derivemgr stats | awk "END{print;exit}" | awk '{ print substr( $2, 0 ) }')
if [ $STATS -lt $WARNLEVEL ]
then
echo "OK: Derived Stats - $STATS"
exitstatus=$STATE_OK
exit $exitstatus
elif [ $STATS -lt $CRITLEVEL -a $STATS -gt $WARNLEVEL ]
then
echo "WARNING: Derived Stats - $STATS"
exitstatus=$STATE_WARNING
exit $exitstatus
elif [ $STATS -gt $CRITLEVEL ]
then
echo "CRITICAL: Derived Stats $STATS"
exitstatus=$STATE_CRITICAL
exit $exitstatus
fi
OK: Derived Stats - 307
I just want to have the result of the script "307" in this example to be displayed on nagvis.
Thanks and Regards,
Del