Page 1 of 1

Accomodate Ping Latency

Posted: Tue Jun 24, 2014 2:12 pm
by klee
Is there a configuration change we can make to ping checks (to accommodate for the delay interval between the ping and response)

We would like to allow for a client device more time to respond to ping (i.e. 15 seconds instead of 5)

Majority of our ping monitors were set up using the Generic Network Device monitoring wizard.

However, going forward, we'll probably enable ping checks using other plugins or wizards.

So it would be great if there's a change we can make which would affect ping monitors universally.

Thanks,

-klee

Re: Accomodate Ping Latency

Posted: Tue Jun 24, 2014 2:24 pm
by tmcdonald
Individual check_ping and check_icmp services can be edited to use the following switches:

http://nagios-plugins.org/doc/man/check_ping.html

Specifically, -1 30 will set a timeout of 30 seconds (default is 10). -p <number> will determine how many pings to send out, and defaults to 5.

There is not a way to set the timeout universally for just check_ping/check_icmp, unless you have a template that is also applied to each of those services.

Re: Accomodate Ping Latency

Posted: Tue Jun 24, 2014 3:45 pm
by klee
Thank you tmcdonald.

Which file(s) or location am I supposed to edit commands with those switches?

The following cannot be modified.

/usr/local/nagios/libexec/check_ping
/usr/local/nagios/libexec/check_icmp

Thanks,

-klee

Re: Accomodate Ping Latency

Posted: Tue Jun 24, 2014 11:17 pm
by Box293
So there are two possibilites here when running the Generic Network Device monitoring wizard.

First there is the host up/down check.
It uses the check_icmp command.
If you want to allow for a timeout of 15 seconds then you would use the option: -t 15

When a host is added using the Generic Network Device monitoring wizard, it uses the settings defined in the template "xiwizard_genericnetdevice_host".
When we go and have a look at template (CCM > Templates > Host Templates) we can see it uses the command "check_xi_host_ping". This has the command defined as:

Code: Select all

$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5
We can simply add the -t 15 to the end of the command and all hosts using this template/command will now have the increased timeout.
  • Go to CCM > Commands
    Edit the "check_xi_host_ping" command
    Append to the end of the command -t 15

    Code: Select all

    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5 -t 15
    Click Save
    Click Apply Configuration
Now all hosts using that template/command will now have the increased timeout.


AND there is the Ping service that was added when runnning the Generic Network Device monitoring wizard.

When a service is added using the Generic Network Device monitoring wizard, it uses the settings defined in the template "xiwizard_genericnetdevice_ping_service".
When we go and have a look at template (CCM > Templates > Service Templates) we can see it uses the command "check_xi_service_ping". This has the command defined as:
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5

We can simply add the -t 15 to the end of the command and all services using this template/command will now have the increased timeout.
  • Go to CCM > Commands
    Edit the "check_xi_service_ping" command
    Append to the end of the command -t 15

    Code: Select all

    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5 -t 15
    Click Save
    Click Apply Configuration
Now all services using that template/command will now have the increased timeout.


IMPORTANT NOTE:
There is the chance that future Nagios XI upgrades will replaced your custom commands with the original command (removing the -t 15). So what you should problably do is clone these commands and templates, modify them and use these with your hosts and services.

Re: Accomodate Ping Latency

Posted: Mon Jun 30, 2014 3:23 am
by klee
Hi Box293,

Thank you very much for your detailed write-up.

I was able to follow you all of your instructions to find the templates and their corresponding commands.

But how do I know which of the 2 ping methods the Generic Network Device monitoring wizard enabled?

Or does it actually enable both? Can you please advise?

Thank You,

-klee

PS: I believe this question came up recently in a separate correspondence between my senior colleague and Slansing (Ticket#2014062310000026).

Re: Accomodate Ping Latency

Posted: Mon Jun 30, 2014 10:22 am
by tmcdonald
klee wrote:But how do I know which of the 2 ping methods the Generic Network Device monitoring wizard enabled?
Quite simply, they are identical:

Code: Select all

check_xi_host_ping
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5 -t 15
check_xi_service_ping
$USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 5 -t 15
However, hosts will use check_xi_host_ping and services will use _check_xi_service_ping. So if you made both a host and a service it should use both.

Re: Accomodate Ping Latency

Posted: Tue Jul 01, 2014 1:38 pm
by klee
Hi tmcdonald,
So if you made both a host and a service it should use both.
I this case, I didn't make much of anything :)

I just followed the Generic network device wizard, which (like all wizards I've encountered so far) creates both host and service cfg files (please see host & service definitions below).

Since xiwizard_genericnetdevice_host is calling check_xi_host_ping and xiwizard_genericnetdevice_ping_service is calling check_xi_service_ping, we should disable one, yes?

At this point, I guess the question are:
1) Which one to disable?
2) Which is the best way to disable it?

Thanks,

-klee
--------------------------------------------------------------------------

define host {
host_name hostname_fqdn
use xiwizard_genericnetdevice_host
address 192.x.x.x
max_check_attempts 3
check_interval 5
retry_interval 2
check_period xi_timeperiod_24x7
contacts ping_contact
notification_interval 20
notification_period xi_timeperiod_24x7
first_notification_delay 0
notifications_enabled 1
icon_image network_node.png
statusmap_image network_node.png
_xiwizard genericnetdevice
register 1
}


define service {
host_name hostname_fqdn
service_description Ping
use xiwizard_genericnetdevice_ping_service
servicegroups IP Monitor
max_check_attempts 3
check_interval 5
retry_interval 2
check_period xi_timeperiod_24x7
notification_interval 20
notification_period xi_timeperiod_24x7
contacts ping_contact
_xiwizard genericnetdevice
register 1
}

Re: Accomodate Ping Latency

Posted: Tue Jul 01, 2014 2:56 pm
by Box293
Everytime you create a host, it has a check that determines if it is up/down. 99% of the time this is a ping check.

When you run a wizard, a lot of the wizards have the option to create a ping service. So this is when it is being created.

So yes, there is a duplication of ping checks. The ping service is optional, and in my opinion is not necessary in basic monitoring.

There are times that a ping service is required. In advanced configurations you can setup service dependancies, however that is a whole different topic.

So if you didn't want the ping services:
a) Don't select the Ping tick box when running the wizards in the future.
b) Delete existing ping services in CCM following these steps:
  • Goto CCM > Services
    In the search field type ping and click search
    Tick ALL ping services EXCEPT FOR localhost
    In the "With Checked" list select Delete and Click Go
    Click Apply Configuration
Now you don't have any duplicate ping services.

Re: Accomodate Ping Latency

Posted: Tue Jul 01, 2014 9:41 pm
by klee
Thank you very much Box293 and tmcdonald.

Your clear and concise responses are always a great help to us and they are truly appreciated.

I shall follow your detailed instructions to disable the ping service.

Please feel free to close this thread.

-klee

Re: Accomodate Ping Latency

Posted: Wed Jul 02, 2014 9:03 am
by tmcdonald
Always good to start the morning with a big thank you like that :)

Closing up.