NRDP Syntax Error when using check_ping

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

NRDP Syntax Error when using check_ping

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDP Syntax Error when using check_ping

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: NRDP Syntax Error when using check_ping

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDP Syntax Error when using check_ping

Post by tgriep »

If fixing the path works, you can leave the redirect as is.
Just another step in debugging the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: NRDP Syntax Error when using check_ping

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDP Syntax Error when using check_ping

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: NRDP Syntax Error when using check_ping

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRDP Syntax Error when using check_ping

Post by tgriep »

Thanks for the update.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked