Page 1 of 1

check_ping with NRPE

PostPosted: Mon Jan 07, 2019 2:08 am
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.

Re: check_ping with NRPE

PostPosted: Mon Jan 07, 2019 2:24 pm
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

Re: check_ping with NRPE

PostPosted: Mon Jan 07, 2019 10:28 pm
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.

Re: check_ping with NRPE

PostPosted: Tue Jan 08, 2019 4:39 pm
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.