Last active
August 29, 2015 14:08
-
-
Save dnsmichi/50c280f3b42a47f5bed4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "[email protected]" | |
vars.is_manager_of = "abteilung1" | |
} | |
object User "admin" { | |
email = "[email protected]" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment