Page 1 of 1

NRDP Syntax Error when using check_ping

Posted: Thu Apr 28, 2016 2:51 pm
by derekb
Hi there,
I can't put my finger on this one. Been using NRDP for remote clients for a while now and haven't had an issue...
Client is installed on the remote device. NRDS config as follows:

Code: Select all

command[__HOST__]=/usr/local/nagios/libexec/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
command[HP PROCURVE  2510G-48  1]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.42 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  2]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.43 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  3]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.51 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  4]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.52 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  5]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.53 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  6]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.54 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  7]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.55 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  8]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.56 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  9]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.57 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  2510G-48  10]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.59 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  E3800-48G  11]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.61 -w 200.0,40% -c 400.0,80% -p 5
command[HP PROCURVE  E3800-48G  12]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.61 -w 200.0,40% -c 400.0,80% -p 5
command[WATCHGUARD FIREBOX  M200 ]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.1 -w 200.0,40% -c 400.0,80% -p 5
command[BARRACUDA WEB FILTER  410 ]=/usr/lib/nagios/plugins/check_ping -H 10.0.10.39 -w 200.0,40% -c 400.0,80% -p 5
When I try to manually run the checks from the remote device:

Code: Select all

root@raspberrypi:/home/pi# /usr/local/nrdp/clients/nrds/nrds.pl -H 'CK Childrens Services Pi' 2>&1
/usr/local/nagios/libexec/check_ping: 1: /usr/local/nagios/libexec/check_ping: Syntax error: word unexpected (expecting ")")
ERROR: STDIN must be either 3 or 4 fields long, I found 2
Sent 14 checks to http://nagios.mydomain.com/nrdp/
However, I can run this just fine:

Code: Select all

root@raspberrypi:/home/pi# /usr/lib/nagios/plugins/check_ping -H 10.0.10.42 -w 200.0,40% -c 400.0,80% -p 5
PING OK - Packet loss = 0%, RTA = 1.63 ms|rta=1.629000ms;200.000000;400.000000;0.000000 pl=0%;40;80;0
Latest Nagios XI 5.2.7, Centos6 fully updated.

Re: NRDP Syntax Error when using check_ping

Posted: Thu Apr 28, 2016 5:19 pm
by tgriep
The path to the check_ping for the host entry and the others are a different paths, you should fix that.
Change the host command from

Code: Select all

command[__HOST__]=/usr/local/nagios/libexec/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
to

Code: Select all

command[__HOST__]=/usr/lib/nagios/plugins/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
[/code]

Also, edit the cron tab entry on the remote system and remove the following

Code: Select all

 2>&1
That has caused an issue similar to what you are getting.

Re: NRDP Syntax Error when using check_ping

Posted: Thu Apr 28, 2016 5:22 pm
by derekb
Thanks. I caught the plugin dir mismatch. That helped

But the 2>&1 part is generated when installing NRDP on the remote device -- it adds that to contrab for the nagios user. Should this be removed all the time?

I'll try it and see what happens

Re: NRDP Syntax Error when using check_ping

Posted: Fri Apr 29, 2016 8:23 am
by tgriep
If fixing the path works, you can leave the redirect as is.
Just another step in debugging the issue.

Re: NRDP Syntax Error when using check_ping

Posted: Mon May 02, 2016 10:23 am
by derekb
Looks like I got the service checks working. However, XI thinks the host itself is down, even though it's sending NRDP checks through to XI properly.

This is what the the host status looks like:
cop1.JPG
And the host settings (I haven't changed anything, I added the host/services via 'Unconfigured Objects'. Only thing changed is the contacts. We ARE getting emails saying the host is down):
cop2.JPG
cop3.JPG
This is the NRDS config:

Code: Select all

command[__HOST__]=/usr/lib/nagios/plugins/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
command[SV8300 Unit 1 - Municipal Office]=/usr/lib/nagios/plugins/check_ping -H 10.197.200.11 -w 200.0,40% -c 400.0,80% -p 5
command[SV8300 Unit 2 - Municipal Office]=/usr/lib/nagios/plugins/check_ping -H 10.197.200.12 -w 200.0,40% -c 400.0,80% -p 5
command[SV8300 Unit 5 - REC Complex]=/usr/lib/nagios/plugins/check_ping -H 10.197.200.15 -w 200.0,40% -c 400.0,80% -p 5
command[SV8300 Unit 6 - Operation Centre]=/usr/lib/nagios/plugins/check_ping -H 10.197.4.131 -w 200.0,40% -c 400.0,80% -p 5
command[SV8300 Unit 7 - Peticoat Library]=/usr/lib/nagios/plugins/check_ping -H 10.254.254.13 -w 200.0,40% -c 400.0,80% -p 5
command[SV8300 Unit 8 - Fire Hall 5]=/usr/lib/nagios/plugins/check_ping -H 10.197.8.131 -w 200.0,40% -c 400.0,80% -p 5
command[UCB - Data Side]=/usr/lib/nagios/plugins/check_ping -H 10.197.0.36 -w 200.0,40% -c 400.0,80% -p 5

Re: NRDP Syntax Error when using check_ping

Posted: Mon May 02, 2016 11:37 am
by tgriep
Is the /usr/lib/nagios/plugins/check_ping a script that uses /bin/ping6 to test the host?
Is the host name localhost resolvable on your Raspberry PI?
Can you login to the PI and run the check from the command line?

Re: NRDP Syntax Error when using check_ping

Posted: Mon May 02, 2016 12:37 pm
by derekb
tgriep wrote:Is the /usr/lib/nagios/plugins/check_ping a script that uses /bin/ping6 to test the host?
Is the host name localhost resolvable on your Raspberry PI?
Can you login to the PI and run the check from the command line?
Yes, the hostname is pingable.

Tried this:

Code: Select all

root@cityofpickering:/home/pi# /usr/lib/nagios/plugins/check_ping -H localhost -w 200.0,40% -c 400.0,80% -p 1
/bin/ping6 -n -U -w 10 -c 1 localhost
CRITICAL - Could not interpret output from ping command
I changed the command to check_ping -H 127.0.0.1, and it seems to be working now

Re: NRDP Syntax Error when using check_ping

Posted: Mon May 02, 2016 12:58 pm
by tgriep
Thanks for the update.