bundlewrap/bundles/icinga2/files/icinga2/users.conf

27 lines
700 B
Plaintext
Raw Normal View History

2020-11-21 09:29:36 +00:00
object UserGroup "on-call_sms" {
display_name = "On-Call Support (with SMS)"
2020-11-21 09:29:36 +00:00
}
% for username, config in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {}).items()):
2020-11-21 09:29:36 +00:00
object User "${username}" {
display_name = "${username}"
enable_notifications = true
period = "24x7"
% if config['is_admin']:
states = [ OK, Warning, Critical, Up, Down ]
types = [ Problem, Recovery, Custom, Acknowledgement ]
% else:
2020-11-22 08:04:02 +00:00
states = [ OK, Warning, Critical, Up, Down ]
2020-11-21 09:29:36 +00:00
types = [ Problem, Recovery ]
% endif
% if config['is_admin'] and (config['email'] or config['phone']):
groups = [ "on-call_sms" ]
% endif
email = "${config['email']}"
vars.mobile = "${config['phone']}"
2020-11-21 09:29:36 +00:00
}
% endfor