Page 1 of 1

Service inherit max_check_attempts from host?

Posted: Thu Dec 08, 2011 11:51 am
by JL3128
I've read the object inheritance manual, but I can't seem to figure out how to make a service inherit max_check_attempts on a per host basis. Basically, I want to define a service with multiple hosts. I don't want to define max_check_attempts in my service template. I want the max_check_attempts attribute to be applied at the host level, then have the service for that host inherit it.

For example hostA might have max_check_attempts set to 3 and hostB might have max_check_attmepts set to 10. Then I define a service and put HostA and HostB in that service. The service then operates with max_check_attempts set to 3 for HostA and 10 for HostB

If I define max_check_attempts at the host level it is inherited for HOST checks, but NOT for SERVICE checks.

With max_check_attempts set in host definition, but not in service definition I get this error:

nagios -v nagios.cfg

<snip>
Error: Invalid max_attempts, check_interval, retry_interval, or notification_interval value for service 'SERVICE' on host 'HOST'
</snip>

Any help, ideas, workarounds, other config options, etc. would be greatly appreciated.

I'm running Nagios Core 3.2.1

Thanks!!

Re: Service inherit max_check_attempts from host?

Posted: Thu Dec 08, 2011 6:44 pm
by jsmurphy
A service cannot inherit definitions from a host, unfortunately not possible. You will need to either use service templates or create multiple services, I can't think of any other way around it at this point in time.