[icinga-users] custom notification method for some service

Antony Stone Antony.Stone at icinga.open.source.it
Tue Jan 17 20:41:37 CET 2017


On Tuesday 17 January 2017 at 20:35:45, Anton Gorlov wrote:

> 17.01.2017 22:10, Anton Gorlov пишет:
> >>> custom variable in service definition example is
> >>> (vars.notification.custom=true )
> >>> apply Service for (http_vhost => config in host.vars.http_vhosts) {
> >>> 
> >>>  import "generic-service"
> >>>  check_command = "http"
> >>>  vars += config
> >>>  vars.notification.custom=true
> >>> 
> >>> }
> >> 
> >> this looks good for me. Have you tried it?
> > 
> > test in progress now :)
> 
> working with
> 
> apply Service for (http_vhost => config in host.vars.http_vhosts) {
>   import "generic-service"
>   check_command = "http"
>   vars += config
>   vars.notification_custom = true
> }
> 
> and
> 
> apply Notification "testing_notify_service" to Service {
>   import "test-notification"
> ...
> assign where service.vars.notification_custom
> }
> 
>  I've just guessed service.vars, but couldn't find it in the documentation

You wouldn't.

"vars" refers to any user-defined (or maybe that should be "admin-defined"?) 
variables in an object definition.

If the object is a Host, then the values can be accessed using 
host.vars.thing; if the object is a Service, you get at the values using 
service.vars.thing; etc.


Regards,


Antony.

-- 
This email was created using 100% recycled electrons.

                                                   Please reply to the list;
                                                         please *don't* CC me.


More information about the icinga-users mailing list