Page 1 of 1

Created a custom check

Posted: Tue Sep 03, 2013 8:44 am
by rdhall01
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

Re: Created a custom check

Posted: Tue Sep 03, 2013 8:51 am
by BanditBBS
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...

Re: Created a custom check

Posted: Tue Sep 03, 2013 8:54 am
by BanditBBS
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

Code: Select all

print "OK - $EWUsers|'Users'=$EWUsers";
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.

Re: Created a custom check

Posted: Tue Sep 03, 2013 9:58 am
by sreinhardt
Thanks Bandit!!

Re: Created a custom check

Posted: Tue Sep 03, 2013 12:35 pm
by rdhall01
Thank you for the help /insight working as it should

Re: Created a custom check

Posted: Tue Sep 03, 2013 1:00 pm
by slansing
Great! Closing the thread, thanks again Bandit.