Nagiosgraph

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

Nagiosgraph

Post by w14219 »

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.
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

Re: Nagiosgraph

Post by w14219 »

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"
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Nagiosgraph

Post by agriffin »

Glad you got it figured out, thanks for posting the solution!
Locked