I am trying to setup nagiosgraph to add a new service and data. However, I cannot seem to get it to work. Can someone please provide me some direction?
Here is my code to gather the needed information I would like to graph ($txccq):
#!/bin/bash
###########################################
## Do basic check on arguments passed to the script.
while test -n "$1"; do
case "$1" in
-H)
host="$2"
shift
;;
-w)
warn="$2"
shift
;;
-c)
critical="$2"
shift
;;
*)
echo "Unknown argument: $1"
exit $STATE_UNKNOWN
;;
esac
shift
done
###########################################
readccq=`cat /tmp/$host-ccq-status.txt|grep tx-ccq| grep -v overall-tx-ccq`
txccq=${readccq//[^0-9]/}
if [ $txccq -ge $warn ]
then
echo "OK- tx-ccq: $txccq"
output= "TX CCQ OK- txccq Data=$txccq"
EXITCODE=0
elif [ $txccq -ge $critical ]
then
echo "WARNING- tx-ccq: $txccq"
output="TX CCQ WARNING- txccq Data=$txccq"
echo $output
EXITCODE=1
else
echo "CRITICAL- tx-ccq: $txccq"
output="TX CCQ CRITICAL- txccq Data=$txccq"
EXITCODE=2
fi
exit ${EXITCODE}
Output of the query is this:
TX CCQ WARNING- txccq Data=87
nagiosgraph map file is this:
/output:*TX CCQ* ([\d]+)/
and push @s, ['tx-ccq',
[ 'Signal Strength', GAUGE, $1 ] ];
Issue:
There are no new RRD files created or are there any new services being created in the nagiosgraph web app. I am not sure what I am doing wrong.....
Thanks in advance.
Nagiosgraph
Re: Nagiosgraph
I believe I got it!
It had nothing to do with the map file. I needed to add |tc-ccq=$txccq to the back of my echo to nagios. Nagiosgraph then was able to gather the performance data from there.
Example:
From this: echo "WARNING- tx-ccq: $txccq"
To this: echo "WARNING- tx-ccq: $txccq|tx-ccq=$txccq"
It had nothing to do with the map file. I needed to add |tc-ccq=$txccq to the back of my echo to nagios. Nagiosgraph then was able to gather the performance data from there.
Example:
From this: echo "WARNING- tx-ccq: $txccq"
To this: echo "WARNING- tx-ccq: $txccq|tx-ccq=$txccq"
Re: Nagiosgraph
Glad you got it figured out, thanks for posting the solution!