NCPA running plugin on the remote server/client

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
windkisser
Posts: 3
Joined: Thu Sep 21, 2017 1:50 am

NCPA running plugin on the remote server/client

Post by windkisser »

Hi All,

Please help.

I'm working on a project using check_ncpa.py that will connect to the client using a plugin/check_ping. However, I always hit the wall that it cannot parse argument.

Command:
CMDLINE=/usr/local/nagios/libexec/check_ncpa.py -H <client_IP> -P 5693 -t 'Token' -M plugins/check_ping -H <client_IP> -w 10,2% -c 20,5%
OUTPUT=check_ping: Could not parse arguments
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-p packets] [-t timeout] [-4|-6]
RETURNCODE=3

Client Log:
2018-02-22 16:29:09,166 1857 INFO 10.105.162.82 - - [2018-02-22 16:29:09] "GET /api/plugins/check_ping/?token=Token&warning=10%2C2%25&critical=20%2C5%25&check=1 HTTP/1.1" 200 328 0.021117

Thank you
kyang

Re: NCPA running plugin on the remote server/client

Post by kyang »

Does the client machine have NCPA installed? How about the plugins?

The client machine is a Linux server correct?

Did you add the path of the plugins in the ncpa.cfg on the client machine?

Code: Select all

plugin_path = /usr/local/nagios/libexec/
I'm running this check from my XI server to my client server that has the plugins and NCPA installed.
(I'm using the client IP address and token)

Code: Select all

./check_ncpa.py -H 192.168.4.174 -t 'xxx' -M 'plugins/check_ping' -a '-H 192.168.4.174 -w 10,2% -c 20,5%'
PING OK - Packet loss = 0%, RTA = 0.05 ms|rta=0.046000ms;10.000000;20.000000;0.000000 pl=0%;2;5;0
windkisser
Posts: 3
Joined: Thu Sep 21, 2017 1:50 am

Re: NCPA running plugin on the remote server/client

Post by windkisser »

Hi Kyang,

Your suggestion worked for me.
./check_ncpa.py -H 192.168.4.174 -t 'xxx' -M 'plugins/check_ping' -a '-H 192.168.4.174 -w 10,2% -c 20,5%'

I'm trying to make check_icmp work as well but no luck.

/usr/local/nagios/libexec/check_ncpa.py -H <ip> -P 5693 -t 'Token' -M plugins/check_icmp -a '-H <ip> -w 200.000ms,40% -c 500.000ms,80%'
kyang

Re: NCPA running plugin on the remote server/client

Post by kyang »

On your client server, what are the permissions of check_icmp?

Code: Select all

ll /usr/local/nagios/libexec/check_icmp
They should be this.

Code: Select all

-r-sr-xr-x 1 root nagios 227208 Jul  6  2017 check_icmp
If not, please make sure the owner is as root nagios

Code: Select all

chown root:nagios /usr/local/nagios/libexec/check_icmp
Then change the permissions using this command.

Code: Select all

chmod u+s /usr/local/nagios/libexec/check_icmp
Now run the check again from your remote server and connect to the client server.

Code: Select all

[root@localhost libexec]# ./check_ncpa.py -H 192.168.4.174 -t 'xxxx' -M 'plugins/check_icmp' -a '-H 192.168.4.174 -w 3000,80% -c 5000,100% -p 5'
OK - 192.168.4.174: rta 0.013ms, lost 0%|rta=0.013ms;3000.000;5000.000;0; pl=0%;80;100;; rtmax=0.042ms;;;; rtmin=0.005ms;;;;
Locked