[ale] need help with nagios plugin
Chuck Payne
terrorpup at gmail.com
Thu Dec 2 11:59:01 EST 2010
Guys,
I need a bit of help, right not I am very upset about the lack of help
I got from the #nagios chat room. I need help with my bash script.
Sorry, I am still a bit of nood on script. I am having an issue with
the syntax.
I have a custom plugin I wrote...see at the bottom. It works I am
getting output, but no prefdata. I have for a link that explain how to
get perfdata, http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN201
2.6
label'=value[UOM];[warn];[crit];[min];[max]
The output I get is....
Total number of Tengu rules are at 8762
I know base of the line about I should be able to get this
tengu=8762; 9000;10000;0
My problem is how to I tell my script this is perfdata do I do some
thing this...
perfdata () { tengu=$r;$w;$c;0}
Is that right?
Chuck
======================================
#!/bin/sh
count () { rm /tmp/tencount ; if [ tengubin =
'/usr/local/magi/bin/tengu' ] ; then /usr/local/magi/bin/tengu
countnolines >> /tmp/tencount ; else /usr/local/magi/bin/fyre
countnolines >> /tmp/tencount; fi ; cat /tmp/tencount ;}
r=$(count)
#test critical
#r=12000
#test warning
#r=9005
w=9000
c=10000
if [ "$r" -gt "$c" ]
then
echo "Total number of Tengu rules are $r and is CRITICAL"
RETVAL=2
elif [ "$r" -gt "$w" ]
then
echo "Warning: Total number of Tengu rules are at $r"
RETVAL=1
else
echo "Total number of Tengu rules are at $r"
RETVAL=0
fi
echo $RETVAL
--
-----------------------------------------
Discover it! Enjoy it! Share it! openSUSE Linux.
-----------------------------------------
openSUSE -- en.opensuse.org/User:Terrorpup
openSUSE Ambassador/openSUSE Member
skype,twiiter,identica,friendfeed -- terrorpup
freenode(irc) --terrorpup/lupinstein
Have you tried SUSE Studio? Need to create a Live CD, an app you want
to package and distribute , or create your own linux distro. Give SUSE
Studio a try. www.susestudio.com.
More information about the Ale
mailing list