2020-11-21 09:29:36 +00:00
|
|
|
object UserGroup "on-call_sms" {
|
2020-12-18 07:24:19 +00:00
|
|
|
display_name = "On-Call Support (with SMS)"
|
2020-11-21 09:29:36 +00:00
|
|
|
}
|
|
|
|
|
2021-02-18 17:12:25 +00:00
|
|
|
% for username, config in sorted(node.metadata.get('icinga2/icinga_users', {}).items()):
|
2020-11-21 09:29:36 +00:00
|
|
|
object User "${username}" {
|
2021-02-17 09:56:18 +00:00
|
|
|
display_name = "${username}"
|
|
|
|
enable_notifications = true
|
|
|
|
period = "24x7"
|
2020-12-27 08:09:40 +00:00
|
|
|
% if not config['is_admin']:
|
2021-02-17 09:56:18 +00:00
|
|
|
states = [ OK, Warning, Critical, Up, Down ]
|
|
|
|
types = [ Problem, Recovery ]
|
2020-12-18 07:24:19 +00:00
|
|
|
% endif
|
2020-11-21 20:46:41 +00:00
|
|
|
|
2020-11-22 10:07:02 +00:00
|
|
|
% if config['is_admin'] and (config['email'] or config['phone']):
|
2021-02-17 09:56:18 +00:00
|
|
|
groups = [ "on-call_sms" ]
|
2020-11-21 20:46:41 +00:00
|
|
|
% endif
|
|
|
|
|
2021-02-17 09:56:18 +00:00
|
|
|
email = "${config['email']}"
|
|
|
|
vars.mobile = "${config['phone']}"
|
2020-11-21 09:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
% endfor
|