Created a custom check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rdhall01
Posts: 87
Joined: Wed Nov 09, 2011 9:53 am

Created a custom check

Post 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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Created a custom check

Post 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...
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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Created a custom check

Post 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.
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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Created a custom check

Post by sreinhardt »

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.
rdhall01
Posts: 87
Joined: Wed Nov 09, 2011 9:53 am

Re: Created a custom check

Post by rdhall01 »

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

Post by slansing »

Great! Closing the thread, thanks again Bandit.
Locked