TransWikia.com

Nagios service check interval based on host type

Server Fault Asked by sebastien.prudhomme on December 11, 2021

I’d like to use different service check interval base on host type. Some hosts are critical and services on these hosts need to be checked more often than service on other hosts.

It seems that is not possible to use host macros in “normal_check_interval”, so any advice to do it without declaring twice my service templates?

Thanks

2 Answers

After rereading Nagios doc, what I need is implied inheritance from host parameters.

I found that old post on nagios-dev list

Unfortunately it has not been implemented into Nagios source code.

I know what I have to do now :-)

Answered by sebastien.prudhomme on December 11, 2021

Since the check_interval and retry_interval are attributes of a service check, they cannot be set per-host like you want. (Don't use "normal_check_interval"... that's Nagios 2 syntax).

To do this, make multiple hostgroups; one for "critical" one for "normal". Then create 2 service definitions for each service you want to check, with different check_interval, retry_interval, and/or max_check_attempts settings, and assign to the hostgroups.

You can make this config cleaner by using a template for the common settings, and just change the intervals in the actual service defs. See the inheritance docs for more info.

Answered by Keith on December 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP