Page 1 of 1
How to get NCPA to do a Ping check
Posted: Wed Jun 12, 2019 8:56 am
by workid
Hi
Im looking to get nagios core to do a ping check on a windows server, i know NSClient++ can do this but id prefer to use NCPA as i have had some issues with NSClient and NCPA works fine for me. I was told i can get NCPA to use the nagios plugin (check_ping) to do this but im not sure how to go about this. I did see an example which is:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -t '<your token>' -P 5693 -M 'plugins/check_ping/-H 192.168.x.x'
but when i try this, i get 'The plugin (check_ping) requested does not exist'
i noticed that the check_ping file is actually in a libexec folder not a one called plugins, so i changed the code to say
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -t '<your token>' -P 5693 -M 'libexec/check_ping/-H 192.168.x.x'
but then i just get an error saying - The node (libexec)requested does not exist. Im not really to sure how to get this working.
Anyone got any clues hot to get NCPA working with Nagios plugins such as check_ping?
Thanks
Re: How to get NCPA to do a Ping check
Posted: Wed Jun 12, 2019 11:11 am
by workid
i have now realised that the 'plugins/check_ping' relates to the plugins folder for NCPA not nagios, i have copied the check_ping file into the plugins folder on the server and used this code
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t '<your token>' -M 'plugins/check_ssh/-H 192.168.x.x'
and are now getting the error:
'Error occurred while running the plugin, Use verbose flag for more details'
any ideas anyone?
Re: How to get NCPA to do a Ping check
Posted: Wed Jun 12, 2019 3:19 pm
by tgriep
The check ping requires warning and critical thresholds.
Code: Select all
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
You would use this example to do that.
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'token' -M 'plugins/check_ping/-H 192.168.x.x -w 3000.0,80% -c 5000.0,100% -p 5'
Re: How to get NCPA to do a Ping check
Posted: Thu Jun 13, 2019 7:41 am
by workid
H, thanks for the help.
I have tried what you said and added the thresholds but I'm still getting the same error reported in Nagios.
Code: Select all
check_ncpa! -H 172.17.x.x -t 'token' -P 5693 -M 'plugins/check_ping/-H 172.17.x.x -w 3000.0,80% -c 5000.0,100% -p 5'
does that look right?
Was it right to copy the 'check_ping' plugin to the server NCPA plugins folder or does it have to run from the Nagios server?
Re: How to get NCPA to do a Ping check
Posted: Thu Jun 13, 2019 8:16 am
by workid
I have tried again using the -v argument to get more info and now the error returns this:
Code: Select all
Connecting to: https://172.17.x.x:5693/api/plugins/check_ping/-H%20172.17.x.x%20-w%203000.0%2C80%25%20-c%205000.0%2C100%25%20-p%205/?token=token&check=1
so it does look like its trying to use the plugin on the server, not sure what the error is when it tries to run the plugin
Re: How to get NCPA to do a Ping check
Posted: Thu Jun 13, 2019 8:42 am
by tgriep
Here is the example command I am running from the Nagios server.
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H ubuntu -t 'ncpapass' -M 'plugins/check_ping/-H localhost -w 3000.0,80% -c 5000.0,100% -p 5'
This is the output showing that it ran.
Code: Select all
PING OK - Packet loss = 0%, RTA = 0.03 ms|rta=0.030000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
Your command does look right and the check_ping plugin has to be in the following folder.
One thing, the check_ping plugin is a compiled plugin and just copying the plugin from another OS will not work all of the time so test the plugin on the remote server by running this.
Code: Select all
/usr/local/ncpa/plugins/check_ping -H 172.17.x.x -w 3000.0,80% -c 5000.0,100% -p 5
See if it runs. If not, fix the command line options or post the message here.
To see the required options, run the plugin with --help.
Code: Select all
/usr/local/ncpa/plugins/check_ping --help
Re: How to get NCPA to do a Ping check
Posted: Thu Jun 13, 2019 9:25 am
by workid
Thanks for the reply, when you put:
Your command does look right and the check_ping plugin has to be in the following folder.
Code: Select all
/usr/local/ncpa/plugins
Does this mean that NCPA needs to be installed on the Nagios Core server? as the server I'm trying to use the check_ping command on a windows server with the NCPA client installed and the check_ping is in the plugins folder (c:\Program Files (x86)\Nagios\NCPA\Plugins)
Re: How to get NCPA to do a Ping check
Posted: Thu Jun 13, 2019 2:16 pm
by scottwilkerson
workid wrote:
Does this mean that NCPA needs to be installed on the Nagios Core server? as the server I'm trying to use the check_ping command on a windows server with the NCPA client installed and the check_ping is in the plugins folder (c:\Program Files (x86)\Nagios\NCPA\Plugins)
Ok, lets clarify something, NCPA is flexible and can be installed on a variety of operating systems, however, when using custom plugins, you can only use plugins that can run on the operating system is is installed on. If you cannot run the plugin from cmd.exe or posershell on a windows machine, you aren't going to be able to make it work from NCPA.
check_ping from your Nagios server is a Linux plugin, and will not run on Windows..
Re: How to get NCPA to do a Ping check
Posted: Fri Jun 14, 2019 5:10 am
by workid
OK, thanks for that. So i wont be able to use NCPA to do a ping check on a windows server. I may just use the Up Time check instead or have to go back to using NSClient++ instead as this does do a ping check as standard, i was just having issues with it working on all our servers, works fine on some but not on others it exactly the same setups.
Anyway thanks for your help
Re: How to get NCPA to do a Ping check
Posted: Fri Jun 14, 2019 6:27 am
by scottwilkerson
workid wrote:OK, thanks for that. So i wont be able to use NCPA to do a ping check on a windows server. I may just use the Up Time check instead or have to go back to using NSClient++ instead as this does do a ping check as standard, i was just having issues with it working on all our servers, works fine on some but not on others it exactly the same setups.
Anyway thanks for your help
no problem