Am 11.09.2014 10:27, schrieb Andreas Lehr:
Hi there,
i have a question regarding scheduled downtimes in icinga2.
Rather: notifications, but for downtimes being started/stopped.
With a standard default installation in Debian via the debmon packages
the notifications.conf looks like this:
/**
* The example notification apply rules.
*
* Only applied if host/service objects have
* the custom attribute `sla` set to `24x7`.
*/
apply Notification "mail-icingaadmin" to Host {
import "mail-host-notification"
user_groups = [ "icingaadmins" ]
assign where host.vars.sla == "24x7"
}
apply Notification "mail-icingaadmin" to Service {
import "mail-service-notification"
user_groups = [ "icingaadmins" ]
assign where service.vars.sla == "24x7"
}
[0] (see below)
The default downtime.conf:
/**
* The example downtime apply rule.
*/
apply ScheduledDowntime "backup-downtime" to Service {
import "backup-downtime"
assign where host.name <http://host.name> == "localhost" &&
service.name <http://service.name> == "load"
}
As far as i understood, there should be no /DowntimeStart/DowntimeEnd/
notification with this configuration due to lack of /vars.sla = "24x7"
/in the downtime.conf.
Nope. That custom attribute named "sla" is set to "24x7" (a string value).
That attribute is used in apply rules for the assign/ignore expressions
in [0].
But unfortunately i get notifications for the Begin and End of downtime.
That's a notification type filter you should define. More on that in the
"Monitoring Basics" chapter in the docs.
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#notification-filters-state-type
What am i missing here?
As Colin already mentioned, fix your notification type filters. I
wouldn't do that in a global template, but rather set it for your
notification apply rule (or define a different template, importing it
and overriding the previously set values).
As for the states and types to be filtered, check the Notification
object docs.
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notification
Kind regards,
Michael
--
Michael Friedrich, DI (FH)
Application Developer
NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]
** Open Source Backup Conference 2014 - September - osbconf.org **
** Puppet Camp Duesseldorf 2014 - Oktober - netways.de/puppetcamp **
** OSMC 2014 - November - netways.de/osmc **
** OpenNebula Conf 2014 - Dezember - opennebulaconf.com **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users