Module: check_mk
Branch: master
Commit: d487b1a10b3d7d56cc72fb9143b6bd506804893f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d487b1a10b3d7d…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed May 23 21:33:13 2012 +0200
Wato: Added pager as contact field
---
modules/check_mk.py | 2 ++
web/htdocs/wato.py | 7 +++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 618177c..d1e9288 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2037,6 +2037,8 @@ def create_nagios_config_contacts(outfile):
outfile.write(" alias\t\t\t\t%s\n" %
contact["alias"].encode("utf-8"))
if "email" in contact:
outfile.write(" email\t\t\t\t%s\n" %
contact["email"])
+ if "pager" in contact:
+ outfile.write(" pager\t\t\t\t%s\n" %
contact["pager"])
not_enabled = contact.get("notifications_enabled", True)
for what in [ "host", "service" ]:
no = contact.get(what + "_notification_options", "")
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a0a2eb0..05f0192 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7447,6 +7447,10 @@ def mode_edit_user(phase):
if email and not re.match(regex_email, email):
raise MKUserError("email", _("'%s' is not a valid
email address." % email))
new_user["email"] = email
+
+ # Pager
+ pager = html.var("pager").strip()
+ new_user["pager"] = pager
# Roles
new_user["roles"] = filter(lambda role:
html.get_checkbox("role_" + role),
@@ -7541,6 +7545,9 @@ def mode_edit_user(phase):
"if the user is a monitoring contact and receives notifications
"
"via Email."))
+ forms.section(_("Pager address"))
+ html.text_input("pager", user.get("pager", ""), size =
50)
+ html.help(_("The pager address is optional "))
forms.header(_("Security"))
forms.section(_("Authentication"))
is_automation = user.get("automation_secret", None) != None