check_ping with NRPE

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_ping with NRPE

Postby vusaravi » Mon Jan 07, 2019 2:08 am

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.
vusaravi
 
Posts: 18
Joined: Fri Mar 13, 2015 7:41 am

Re: check_ping with NRPE

Postby cdienger » Mon Jan 07, 2019 2:24 pm

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.
User avatar
cdienger
Support Tech
 
Posts: 2683
Joined: Tue Feb 07, 2017 11:26 am

Re: check_ping with NRPE

Postby vusaravi » Mon Jan 07, 2019 10:28 pm

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.
vusaravi
 
Posts: 18
Joined: Fri Mar 13, 2015 7:41 am

Re: check_ping with NRPE

Postby ssax » Tue Jan 08, 2019 4:39 pm

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 3793
Joined: Wed Feb 11, 2015 12:54 pm


Return to Nagios Core

Who is online

Users browsing this forum: benjaminsmith, SOIConsoleMonitoring and 30 guests