I have created a custom check for an application, and it is returning the correct info as expected but Im not getting the performance data to graph the output! included is the script named test3 and the results. Im looking for help to help get the perfromance data working correctly
#!/usr/bin/perl
use strict;
use warnings;
my $HOSTNAME = $ARGV[0];
my $EWUsers=`wget "http://XXXX.XXXX.com/adminportal/utilit ... XXXXXX.com" -q -O - |grep Users |cut -d ":" -f 2 |tr -d " "`;
if ($EWUsers < "200") {
print "OK - $EWUsers";
exit(0);}
if ($EWUsers < "210") {
print "WARNING - $EWUsers";
exit(1);}
if ($EWUsers >= "210") {
print "CRITICAL - $EWUsers";
exit(2);}
print "UNKNOWN|$EWUsers";
exit(3);
output
OK - 72
Created a custom check
Re: Created a custom check
You need to adjust your returning data. You need to include the performance data in your text. Let me try and find the link to the docs...
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Created a custom check
http://nagiosplug.sourceforge.net/devel ... tml#AEN200
There are the docs for adding performance data to a check. Basically add a | and then after that you add the data in the format described in the doc.
EDIT: Adding an example
The other fields are optional and you of course want to change it on all the return codes so it is mapped during issues as well.
There are the docs for adding performance data to a check. Basically add a | and then after that you add the data in the format described in the doc.
EDIT: Adding an example
Code: Select all
print "OK - $EWUsers|'Users'=$EWUsers";2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Created a custom check
Thanks Bandit!!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Created a custom check
Thank you for the help /insight working as it should
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Created a custom check
Great! Closing the thread, thanks again Bandit.