Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Explain the following:
1) Which User is getting notified for which Host?
2) Which assign/ignore expressions match for the Hosts and Users?
/* generated by puppet */
object Host "puppet-generated-host1" {
import "puppet-host"
import "db-server"
check_Command = "generated-hostalive"
vars.notify_mgmt = true
vars.has_sla = "24x7"
}
object Host "puppet-generated-host2" {
import "puppet-host"
import "db-server"
check_Command = "generated-hostalive"
vars.has_sla = "24x7"
}
/* configuration in icinga2 for notifications */
apply Notification "notify-host-by-mail" to Host {
user_groups = [ "mgmt" ]
states = [ Down ]
types = [ Problem, Recovery ]
command = "notify-by-mail"
interval = 1h
period = "24x7"
assign where host.vars.has_sla == "24x7" && host.vars.notify_mgmt == true && "db-server" in host.templates
ignore where host.vars.no_notify == true
}
object UserGroup "mgmt" {
assign where user.vars.is_manager_of != ""
}
object User "manager" {
email = "mgmt@firma.com"
vars.is_manager_of = "abteilung1"
}
object User "admin" {
email = "admin@firma.com"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment