Module: check_mk
Branch: master
Commit: 75170cdc44fa4303562acfcd424ce248698446b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=75170cdc44fa43…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Apr 14 17:40:36 2016 +0200
Internal cleanups: cleaned up some dynamic function declarations
---
web/plugins/icons/wato.py | 14 +++++++++++---
web/plugins/views/layouts.py | 6 +++++-
web/plugins/views/mkeventd.py | 14 +++++++++++---
3 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/web/plugins/icons/wato.py b/web/plugins/icons/wato.py
index 02aaa89..ffc154c 100644
--- a/web/plugins/icons/wato.py
+++ b/web/plugins/icons/wato.py
@@ -80,7 +80,15 @@ multisite_icons_and_actions['wato'] = {
# | Action for downloading the current agent output |
# '----------------------------------------------------------------------'
-def paint_download_agent_output(what, row, tags, host_custom_vars, ty):
+def paint_download_agent_output(*args):
+ return paint_download_host_info(*args, ty="agent")
+
+
+def paint_download_snmp_walk(*args):
+ return paint_download_host_info(*args, ty="walk")
+
+
+def paint_download_host_info(what, row, tags, host_custom_vars, ty):
if (what == "host" or (what == "service" and
row["service_description"] == "Check_MK")) \
and config.may("wato.download_agent_output") \
and not row["host_check_type"] == 2: # Not for shadow hosts
@@ -109,14 +117,14 @@ def paint_download_agent_output(what, row, tags, host_custom_vars,
ty):
multisite_icons_and_actions['download_agent_output'] = {
'host_columns' : [ "filename", "check_type" ],
- 'paint' : lambda *args: paint_download_agent_output(*args,
ty="agent"),
+ 'paint' : paint_download_agent_output,
'toplevel' : False,
'sort_index' : 50,
}
multisite_icons_and_actions['download_snmp_walk'] = {
'host_columns' : [ "filename" ],
- 'paint' : lambda *args: paint_download_agent_output(*args,
ty="walk"),
+ 'paint' : paint_download_snmp_walk,
'toplevel' : False,
'sort_index' : 50,
}
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index 5640a3c..e2e248d 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -350,9 +350,13 @@ multisite_layouts["boxed"] = {
# '----------------------------------------------------------------------'
+def render_grouped_boxed_graphs(*args):
+ return render_grouped_boxes(*args, css_class="graph")
+
+
multisite_layouts["boxed_graph"] = {
"title" : _("Balanced graph boxes"),
- "render" : lambda *args: render_grouped_boxes(*args +
("graph",)),
+ "render" : render_grouped_boxed_graphs,
"group" : True,
"checkboxes" : True,
}
diff --git a/web/plugins/views/mkeventd.py b/web/plugins/views/mkeventd.py
index 19039bd..135829b 100644
--- a/web/plugins/views/mkeventd.py
+++ b/web/plugins/views/mkeventd.py
@@ -42,7 +42,15 @@ except:
# | |
# '----------------------------------------------------------------------'
-def table_events(what, columns, add_headers, only_sites, limit, filters):
+def table_event_history(*args):
+ return table_event_table("history", *args)
+
+
+def table_events(*args):
+ return table_event_table("events", *args)
+
+
+def table_event_table(what, columns, add_headers, only_sites, limit, filters):
# First we fetch the list of all events from mkeventd - either current
# or historic ones. We ignore any filters for host_ here. Note:
# event_host and host_name needn't be compatible. They might differ
@@ -299,7 +307,7 @@ if mkeventd_enabled:
multisite_datasources["mkeventd_events"] = {
"title" : _("Event Console: Current Events"),
- "table" : lambda *args: table_events('events', *args),
+ "table" : table_events,
"infos" : [ "event", "host" ],
"keys" : [],
"idkeys" : [ 'site', 'host_name',
'event_id' ],
@@ -308,7 +316,7 @@ if mkeventd_enabled:
multisite_datasources["mkeventd_history"] = {
"title" : _("Event Console: Event History"),
- "table" : lambda *args: table_events('history', *args),
+ "table" : table_event_history,
"infos" : [ "history", "event",
"host" ],
"keys" : [],
"idkeys" : [ 'site', 'host_name',
'event_id', 'history_line' ],