check_ping with NRPE

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vusaravi
Posts: 23
Joined: Fri Mar 13, 2015 7:41 am

check_ping with NRPE

Post by vusaravi »

Hi Experts

I am trying to ping remote server from one of my remote servers (client), for this i am using check_ping command in nrpe (check_nrpe).

By default it is sending only one packet to get the RTA/packet loss, is there any way to define the packets count or can we pass the count via command line arguments?.

Below is the sample command and response.

Code: Select all

[root@XXXX libexec]# ./check_nrpe -H 10.X.X.20 -c check_ping -a host=10.X.X.14  show-all 
OK: 1/1 (10.X.X14 Packet loss = 0%, RTA = 0ms)|'10.X.X.14_loss'=0;5;10 '10.X.X.14_time'=0;60;100
Thanks in advance.
Last edited by vusaravi on Mon Jan 07, 2019 10:23 pm, edited 1 time in total.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_ping with NRPE

Post by cdienger »

It looks like you're using nsclient++ on the remote machines. You can specify the number of packets to send with the count option
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vusaravi
Posts: 23
Joined: Fri Mar 13, 2015 7:41 am

Re: check_ping with NRPE

Post by vusaravi »

Thanks @cdienger

I have tried that too, but it is just filtering the output based on the count value.

Below are the only available options with check_ping command.

filter= Filter which marks interesting items.
warning=time > 60 or loss > 5% Filter which marks items which generates a warning state.
warn= Short alias for warning
critical=time > 100 or loss > 10% Filter which marks items which generates a critical state.
crit= Short alias for critical.
ok= Filter which marks items which generates an ok state.
debug Show debugging information in the log
show-all Show details for all matches regardless of status (normally details are only showed for warnings and criticals).
empty-state=unknown Return status to use when nothing matched filter.
perf-config= Performance data generation configuration
escape-html Escape any < and > characters to prevent HTML encoding
help Show help screen (this screen)
help-pb Show help screen as a protocol buffer payload
show-default Show default values for a given command
help-short Show help screen (short forma

And below are the default values:
"warning=time > 60 or loss > 5%" "critical=time > 100 or loss > 10%" "empty-state=unknown" "top-syntax=${status}: ${ok_count}/${count} (${problem_list})" "ok-syntax=%(status): All %(count) hosts are ok" "empty-syntax=No hosts found" "detail-syntax=${ip} Packet loss = ${loss}%, RTA = ${time}ms" "perf-syntax=${host}" "count=1" "timeout=500"

It will be good to track the packet loss if the sending packet count is more than 1.

Tried several ways, but no luck.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_ping with NRPE

Post by ssax »

This is a bug with NSClient++, you may want to report it to their developers. No matter what I specify the count is always 1.

Code: Select all

check_ping count=3 host=192.168.232.21 show-all
L        cli OK: OK: 1/1 (192.168.232.21 Packet loss = 0%, RTA = 1ms)
L        cli  Performance data: '192.168.232.21_loss'=0;5;10 '192.168.232.21_time'=1;60;100
Your only option would be to use a different plugin at this point.
Locked