[icinga-users] Service inheritance

Michael Friedrich michael.friedrich at gmail.com
Wed Mar 13 20:52:13 CET 2013


On 13.03.2013 20:42, Simon Oosthoek wrote:
> On 03/13/2013 05:32 PM, Michael Friedrich wrote:
>> On 13.03.2013 16:46, Simon Oosthoek wrote:
>>> Another way might be to define a custom variable (macro) in the host
>>> definition that is later used in the generic service definition to set
>>> host specific parameters. I suppose this means you have to set the
>>> custom macro in all host definitions or their ancestor. see
>>>
>>> http://docs.icinga.org/latest/en/customobjectvars.html#basicscustomvars
>> no. custom var macros are interpreted on runtime. not on config read and
>> object processing and resolving the final attributes. so i am not
>> entirely sure what your idea is here, but the approach will fail.
>>
> Perhaps my choice of words was wrong, but I think I'm using this
> already: (In nagios 3.0.5, haven't tried the same on icinga yet)

that proposal highly depends on what you interpret into "parameters". 
the initial post does not clarify on the issue, so it's highly likely 
that your attempt is correct. _if_ parameters are just command 
arguments, i.e. thresholds to be passed to a command call.

_if_ parameters are service attributes though, which should be interited 
/ excluded somehow, that trick does not work, as they are static on 
configuration object processing where macros are not allowed / resolved 
(although it would be nice, but that won't happen with 1.x).

>
> define host{
>           use                     debian-dom0-host
>           host_name               minerva
>           parents                 bit2-switch01
>           address                 10.110.11.123
>           _WARNVMS                28
>           _CRITVMS                31
>           }
>
> define host{
>           use                     debian-dom0-host
>           host_name               vulcan
>           parents                 bit1-switch02
>           address                 10.110.11.124
>           _WARNVMS                25
>           _CRITVMS                31
>           }
>
>
> And then
>
>
> define service{
>           use                             generic-service,srv-pnp
>           hostgroup_name                  debian-dom0
>           service_description             Xen VMs
>           check_command
> check_nrpe!check_xen_vms!$_HOSTWARNVMS$!$_HOSTCRITVMS$
>           }
>
>
> Admittedly, this could probably be better/just as well done using a
> local thing in nrpe.cfg in the command definition, but at the time I
> thought this was an interesting way to try.
>
> I think this works as expected, but please correct me if it's by
> accident ;-)
>
> /Simon
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/icinga-users


-- 
DI (FH) Michael Friedrich

mail:     michael.friedrich at gmail.com
twitter:  https://twitter.com/dnsmichi
jabber:   dnsmichi at jabber.ccc.de
irc:      irc.freenode.net/icinga dnsmichi

icinga open source monitoring
position: lead core developer
url:      https://www.icinga.org





More information about the icinga-users mailing list