2

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

3
  • Don't declare the template twice, just declare a second tiny template that inherits all values from the first but changes normal_check_interval.
    – MadHatter
    Dec 2, 2013 at 13:16
  • I don't want to have a second tiny template as i don't want to multiply them (I yet have more than 600 service templates and it's hard to manage them) Dec 2, 2013 at 13:43
  • 1
    Fair enough. I find the difficulty in managing templates starts when a given value is defined similarly in multiple templates, but that may be just me. Nevertheless, my feeling is that cascading templates is the mechanism NAGIOS provides for doing this, so if you won't use that, you may find there's no easy way to do it.
    – MadHatter
    Dec 2, 2013 at 14:04

2 Answers 2

1

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.

0

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 :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .