check_period inheritance

Running nagios 3.2.0

I have been doing some digging to see if this is possible but I haven’t found anything solid.

I have about ~1000 hosts sharing around 100 different services. Services are implemented using templates/inheritance for most settings.

I would like to start adding many different check_periods for checking these hosts. It is easy for me to attach a check_period to a host. It would take quite a bit of configuration changes to create a different service just to change the check_period.

Is it possible through service->host inheritance to get the check_period for the service from the host definition? If not, can this be accomplished by any means other than having a different service defined for each time period? (nCP * nServices)?

Thanks for your help.
mlr

I dont’ think it can be done as the host definiton only has info about the check_host_alive timings…
How mayn different service timings do you need?
you could define three or four servicie definitions with different timings and associate these to different hostgroups. I think this coul dbe the fastest way to obtain different cehck intervals on different hosts…

Luca

From what I can tell, the service will inherit the notification_period from the host, it just doesn’t inherit check_period.

The problem with adding new services, is that I basically need to replicate 50+ services for every check_interval I need which gets long very quickly.

Is there any other way besides inheritance that will accomplish this that I am not thinking of?

Thanks

Services do not inherit anything from the host.
You can have a service inherit if you use a service template, but not from the host.

Not necessarily true, search for Implied Inheritance.

nagios.sourceforge.net/docs/3_0/ … nheritance

I’m wondering if there is a way to accomplish this with check_period…

thanks for pointing that out. You really never stop learning :slight_smile:

But still your “problem” doesn’t change.
Either you create different service templates, or you create a different host template differentiating the object property you need.
If your timing differences depend on the host it’s probably best to use host templates so you can create the service definition once for each service.