Page 1 of 1

Variations in monitored services (inheritance question?)

Posted: Fri Jul 12, 2019 4:53 am
by peterg
We have an estate of approximately 60 Nagios monitored servers which are not identical. By that I mean some have devices and services present that are missing on on others.

The configuration file is structured such that there is a template service{} definition that all our other specific checks inherit. At the moment these are all simple things (disk, load, user, etc) that every server can support. I want to extend this to check specific things on certain systems but I can't figure out the correct way to set this up in the configuration file. If I add these to the configuration file every server will try to check them and many will fail.

The structure of the configuration file is like this:

Generic host{} definition followed by a list of host definitions that inherit it.

A hostgroup{} definition which lists all 60+ hosts.

Generic service{} definition as mentioned at the top and a collection of services that inherit it.

I've looked at the Object inheritance page in the manual but I can't see how to apply it to this problem.

If someone has an example of host specific checks that would be a good start.

Re: Variations in monitored services (inheritance question?)

Posted: Fri Jul 12, 2019 3:22 pm
by benjaminsmith
Hi @peterg,

Perhaps you have already considered this but you can inherit templates from multiple sources. So if you already have a generic template for your services, then you can create another template for specific checks.

Local values in the service definition will take precedent over template values, and in the case of using multiple templates, the first template specified will take priority over the previews templates.

Object Inheritance With Templates

Let me know if that answers your question or not.

Re: Variations in monitored services (inheritance question?)

Posted: Wed Jul 17, 2019 6:10 am
by peterg
@benjaminsmith I should have said, I'm still on Nagios 3, does that support multiple inheritance? If so that should work. If not, I can migrate to 4.

Peter

Re: Variations in monitored services (inheritance question?)

Posted: Thu Jul 18, 2019 1:31 pm
by benjaminsmith
Hi Peter,

Yes. Nagios 3 supports object inheritance.

Nagios 3 Core Documentation