check_nt to check_nrpe checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

check_nt to check_nrpe checks

Post by jkinning »

I have been using the check_nt command provided by Nagios XI check_xi_service_nsclient check command to monitor Page File Usage. My check command is $USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$ and in $ARG2$=COUNTER and $ARG3$= -l "\\Paging File(_Total)\\% Usage","Paging File usage is %.2f %%" -w 70 -c 90. How can I get similiar results with using check_nrpe?

I am also using the same check for Server Work Queue with these $ARG2$=COUNTER $ARG3$= -l "\\Server Work Queues(0)\\Queue Length","Current work queue (an indication of processing load) is %.f " -w 4 -c 7

Finally, I also can't get services checks figured out either. Using $USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$ my $ARG2$=SERVICESTATE and $ARG3$= -l SepMasterService -d SHOWALL How can I get this check to work with check_nrpe?

If it isn't a big deal I'll continue using my check_nt checks if it will still be supported in the future. I just don't want to be using checks that will be unsupported in the future.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_nt to check_nrpe checks

Post by jdalrymple »

check_nt will probably continue to be supported for many years to come - but we can still help you migrate if you wish. There is often additional functionality in the check_nrpe counterparts.

Page File:

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <winhost> -c check_pagefile -a "warning=used > 70%" "critical=used > 90%"
OK: \??\C:\pagefile.sys 24.918MB (15.91GB), total 24.918MB (15.91GB)|'\??\C:\pagefile.sys'=0.02433GB;11.1372;14.31925;0;15.91028 '\??\C:\pagefile.sys %'=0%;69;89;0;100 'total'=0.02433GB;11.1372;14.31925;0;15.91028 'total %'=0%;69;89;0;100
PerfCounter:

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <winhost> -c checkcounter -a "Counter=\\Server Work Queues(0)\\Queue Length" MaxWarn=4 MaxCrit=7
OK: \Server Work Queues(0)\Queue Length = 0|'\Server Work Queues(0)\Queue Lengthnone'=0;4;7
Services:

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <winhost> -c check_service -a 'service=SepMasterService'
Failed to open service: SepMasterService
[root@jrd-cent65-1 libexec]# echo $?
3
The default is OK if it's running and Critical if it's not:

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <winhost> -c check_service -a 'service=spooler'
OK: All 1 service(s) are ok.
-- Ran net stop spooler here --

Code: Select all

[root@localhost libexec]# ./check_nrpe -H <winhost> -c check_service -a 'service=spooler'
CRITICAL: spooler=stopped (auto), delayed ()
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_nt to check_nrpe checks

Post by Box293 »

check_nrpe checks just allow more flexibility.

I have documented several different examples of common checks here on my website, you might find them useful.

http://sites.box293.com/nagios/guides/common-checks
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: check_nt to check_nrpe checks

Post by jkinning »

Super!

Thanks for all the feedback and appreciate the link.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: check_nt to check_nrpe checks

Post by jkinning »

I tried to add the check_pagefile check but for some reason the Nagios XI is not recognizing the command correctly. If I run the check on the Nagios XI server directly it works

From the GUI Test Check:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H <host> -t 30 -c check_pagefile -a "warning=used \> 70%" "critical=used \> 90%"
OUTPUT: Failed to validate filter see log for details

From the terminal on the server:
./check_nrpe -H <host> -t 30 -c check_pagefile -a "warning=used > 70%" "critical=used > 90%"
OK: \??\C:\pagefile.sys 38.723MB (2.292GB), total 38.723MB (2.292GB)|'\??\C:\pagefile.sys'=0.03781GB;1.60424;2.06259;0;2.29177 '\??\C:\pagefile.sys %'=1%;70;90;0;100 'total'=0.03781GB;1.60424;2.06259;0;2.29177 'total %'=1%;70;90;0;100
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: check_nt to check_nrpe checks

Post by jkinning »

Tried the Server Work Queue check and it appears the Nagios XI Test Check Command "feature" is adding additional spaces or seeing additional spaces and placing \\ where it sees them or something.

From the GUI test:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H <host> -t 30 -c checkcounter -a "Counter=\\\\Server Work Queues\(0\)\\\\Queue Length" MaxWarn=4 MaxCrit=7
OUTPUT: Failed to poll counter: PdhCollectQueryData failed: : 800007d5: No data to return.

From the terminal:
./check_nrpe -H <host> -t 30 -c checkcounter -a "Counter=\\Server Work Queues(0)\\Queue Length" MaxWarn=4 MaxCrit=7
OK: \Server Work Queues(0)\Queue Length = 0|'\Server Work Queues(0)\Queue Lengthnone'=0;4;7
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: check_nt to check_nrpe checks

Post by jkinning »

I added the checks and everything works. Looks like a bug with the Test Command feature within the Nagios XI gui.

Is there a process to file a bug or check to see if this issue has already been filed?

Thanks again everyone!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_nt to check_nrpe checks

Post by jdalrymple »

The "Test Command" feature is not the definitive way to test a command. It unfortunately cannot be relied upon because of PHP character manipulation and also apache/nagios privilege separation. If it works for you there is nothing to worry about, and while it's nice that the test command button does work for some things - never take it as an indication that your check will definitely NOT work just because that button doesn't return proper results.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: check_nt to check_nrpe checks

Post by jkinning »

Good to know. I'll start relying on the terminal command and avoid time delay and frustrations in the future.

Thanks again.

This can be closed.
Locked