Module: check_mk
Branch: master
Commit: 9b251c97f78100664ec15250787394c4cadbd480
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b251c97f78100…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 12 15:48:21 2015 +0200
Preparations for alert handlers
---
modules/check_mk.py | 14 ++++++++++----
web/plugins/sidebar/shipped.py | 5 ++++-
web/plugins/views/painters.py | 1 +
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 6aedca7..42a9770 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4484,6 +4484,7 @@ def usage():
cmk --scan-parents [HOST1 HOST2...] autoscan parents, create conf.d/parents.mk
cmk -P, --package COMMAND do package operations
cmk --localize COMMAND do localization operations
+ cmk --handle-alerts used to handle alerts from core
cmk --notify used to send notifications from core
cmk --create-rrd [--keepalive|SPEC] create round robin database (only CMC)
cmk --convert-rrds [--split] [H...] convert exiting RRD to new format (only CMC)
@@ -4514,8 +4515,8 @@ OPTIONS:
is directed into a pipe or file.
--procs N start up to N processes in parallel during --scan-parents
--checks A,.. restrict checks/inventory to specified checks (tcp/snmp/check type)
- --keepalive used by Check_MK Mirco Core: run check and --notify in continous
- mode. Read data from stdin and von from cmd line and environment
+ --keepalive used by Check_MK Mirco Core: run check and --notify or --handle-alerts
+ in continous mode. Read data from stdin and from cmd line.
--cmc-file=X relative filename for CMC config file (used by -B/-U)
--extraoid A Do --snmpwalk also on this OID, in addition to mib-2 and enterprises.
You can specify this option multiple times.
@@ -5712,7 +5713,7 @@ long_options = [ "help", "version",
"verbose", "compile", "debug", "interactive"
"list-checks", "list-hosts", "list-tag",
"no-tcp", "cache",
"flush", "package", "localize",
"donate", "snmpwalk", "oid=", "extraoid=",
"snmptranslate", "bake-agents", "force",
"show-snmp-stats",
- "usewalk", "scan-parents", "procs=",
"automation=", "notify",
+ "usewalk", "scan-parents", "procs=",
"automation=", "handle-alerts", "notify",
"snmpget=", "profile", "keepalive",
"keepalive-fd=", "create-rrd",
"convert-rrds", "split-rrds",
"no-cache", "update", "restart",
"reload", "dump", "fake-dns=",
@@ -5721,7 +5722,8 @@ long_options = [ "help", "version",
"verbose", "compile", "debug", "interactive"
"checks=", "inventory",
"inventory-as-check=", "hw-changes=", "sw-changes=",
"cmc-file=", "browse-man", "list-man",
"update-dns-cache", "cap" ]
-non_config_options = ['-L', '--list-checks', '-P',
'--package', '-M', '--notify',
+non_config_options = ['-L', '--list-checks', '-P',
'--package', '-M',
+ '--handle-alerts', '--notify',
'--man', '-V', '--version' ,'-h',
'--help', '--automation',
'--create-rrd', '--convert-rrds',
'--keepalive', '--cap' ]
@@ -5926,6 +5928,10 @@ try:
execfile(modules_dir + "/inventory.py")
do_inv_check(a)
done = True
+ elif o == '--handle-alerts':
+ read_config_files(with_conf_d=True, validate_hosts=False)
+ sys.exit(do_notify(args))
+ # sys.exit(do_handle_alerts(args))
elif o == '--notify':
read_config_files(with_conf_d=True, validate_hosts=False)
sys.exit(do_notify(args))
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 3a2b2b2..e9bb5ec 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -947,6 +947,7 @@ def render_master_control():
( "enable_flap_detection", _("Flap Detection" )),
( "enable_event_handlers", _("Event handlers" )),
( "process_performance_data", _("Performance data" )),
+ ( "enable_event_handlers", _("Alert handlers" )),
]
html.live.set_prepend_site(True)
@@ -961,7 +962,9 @@ def render_master_control():
html.write("<table class=master_control>\n")
for i, (colname, title) in enumerate(items):
# Do not show event handlers on Check_MK Micro Core
- if is_cmc and colname == 'enable_event_handlers':
+ if is_cmc and title == _("Event handlers"):
+ continue
+ elif not is_cmc and title == _("Alert handlers"):
continue
colvalue = siteline[i + 1]
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index b945027..7b3c517 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1868,6 +1868,7 @@ def paint_downtime_recurring(row):
1: _("hourly"),
2: _("daily"),
3: _("weekly"),
+ 999: _("every 5 minutes"),
}.get(r, _("(unknown)"))
multisite_painters["downtime_recurring"] = {