Module: check_mk
Branch: master
Commit: 794103fd8b46ddfc85e61d94642f7b0caed263c5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=794103fd8b46dd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 30 16:05:40 2014 +0200
#1411 New builting views for the history of scheduled downtimes
---
.werks/1411 | 9 +++++
ChangeLog | 1 +
web/plugins/views/builtin.py | 91 ++++++++++++++++++++++++++++++++++++++++++
web/plugins/views/filters.py | 1 +
4 files changed, 102 insertions(+)
diff --git a/.werks/1411 b/.werks/1411
new file mode 100644
index 0000000..0046823
--- /dev/null
+++ b/.werks/1411
@@ -0,0 +1,9 @@
+Title: New builting views for the history of scheduled downtimes
+Level: 2
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1412085926
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4b077df..6a560da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -108,6 +108,7 @@
* 1398 Allow to spread times of next check when rescheduling...
* 1405 Checkbox for settings downtimes on the hosts of the selected services...
* 1410 Output log text of scheduled downtime log entries...
+ * 1411 New builting views for the history of scheduled downtimes
* 1067 FIX: Fixed login problem in LDAP connector when no user filter specified...
* 1094 FIX: sidebar snaping 'Tree of folders': fixed exception
* 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after
editing availability options...
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index 1d5d26e..1dd6022 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -390,6 +390,39 @@ multisite_builtin_views.update({
'sorters': [('downtime_what', False),
('downtime_start_time', False)],
'title': _('Downtimes')},
+
+'downtime_history': {'browser_reload': 0,
+ 'column_headers': 'pergroup',
+ 'datasource': 'log_events',
+ 'description': _('All historic scheduled downtimes of hosts and
services'),
+ 'group_painters': [],
+ 'hard_filters': [ 'log_type' ],
+ 'hard_filtervars': [('logtime_from_range', '86400'),
+ ('logtime_from', '60'),
+ ('log_type', 'SERVICE DOWNTIME ALERT'),
+ ],
+ 'hidden': False,
+ 'hide_filters': [],
+ 'icon' : 'downtime',
+ 'layout': 'table',
+ 'linktitle': _('Host Dt-History'),
+ 'mustsearch': False,
+ 'num_columns': 1,
+ 'painters': [('log_icon', None),
+ ('log_time', None),
+ ('host', 'host_dt_hist'),
+ ('service_description', 'svc_dt_hist'),
+ ('log_state_type', None),
+ ('log_plugin_output', None),
+ ],
+ 'play_sounds': False,
+ 'public': True,
+ 'show_filters': ['logtime', ],
+ 'sorters': [('log_time', True), ('log_lineno',
True)],
+ 'title': _('History of scheduled downtimes'),
+ 'topic': _('Other'),
+},
+
'api_downtimes': {'column_headers': 'pergroup',
'datasource': 'downtimes',
'description': _('All host- and service-downtimes (including
ids)'),
@@ -1856,6 +1889,35 @@ multisite_builtin_views.update({
'show_filters': ['logtime', 'log_state'],
'sorters': [('log_time', True), ('log_lineno',
True)],
'title': _('Events of host')},
+
+'host_dt_hist': {'browser_reload': 0,
+ 'column_headers': 'pergroup',
+ 'datasource': 'log_events',
+ 'description': _('All historic scheduled downtimes of a certain
host'),
+ 'group_painters': [],
+ 'hard_filters': [ 'log_type' ],
+ 'hard_filtervars': [('logtime_from_range', '86400'),
+ ('logtime_from', '60'),
+ ('log_type', 'HOST DOWNTIME ALERT'),
+ ],
+ 'hidden': True,
+ 'hide_filters': ['site', 'host' ],
+ 'icon' : 'downtime',
+ 'layout': 'table',
+ 'linktitle': _('Host Dt-History'),
+ 'mustsearch': False,
+ 'num_columns': 1,
+ 'painters': [('log_icon', None),
+ ('log_time', None),
+ ('log_state_type', None),
+ ('log_plugin_output', None),
+ ],
+ 'play_sounds': False,
+ 'public': True,
+ 'show_filters': ['logtime', ],
+ 'sorters': [('log_time', True), ('log_lineno',
True)],
+ 'title': _('Historic downtimes of host')},
+
'svcevents': {'browser_reload': 0,
'column_headers': 'pergroup',
'datasource': 'log_events',
@@ -1885,6 +1947,35 @@ multisite_builtin_views.update({
'show_filters': ['logtime', 'log_state'],
'sorters': [('log_time', True), ('log_lineno',
True)],
'title': _('Events of service')},
+
+'svc_dt_hist': {'browser_reload': 0,
+ 'column_headers': 'pergroup',
+ 'datasource': 'log_events',
+ 'description': _('All historic scheduled downtimes of a certain
service'),
+ 'group_painters': [],
+ 'hard_filters': [ 'log_type' ],
+ 'hard_filtervars': [('logtime_from_range', '86400'),
+ ('logtime_from', '60'),
+ ('log_type', '(HOST|SERVICE) DOWNTIME
ALERT'),
+ ],
+ 'hidden': True,
+ 'hide_filters': ['site', 'host', 'service'],
+ 'icon' : 'downtime',
+ 'layout': 'table',
+ 'linktitle': _('Downtime-History'),
+ 'mustsearch': False,
+ 'num_columns': 1,
+ 'painters': [('log_icon', None),
+ ('log_time', None),
+ ('log_state_type', None),
+ ('log_plugin_output', None),
+ ],
+ 'play_sounds': False,
+ 'public': True,
+ 'show_filters': ['logtime', ],
+ 'sorters': [('log_time', True), ('log_lineno',
True)],
+ 'title': _('Historic downtimes of service')},
+
'hostsvcevents': {'browser_reload': 0,
'column_headers': 'pergroup',
'datasource': 'log_events',
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index d764df4..32c5387 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -703,6 +703,7 @@ class FilterLogClass(Filter):
declare_filter(255, FilterLogClass())
declare_filter(202, FilterText("log_plugin_output", _("Log: plugin
output"), "log", "log_plugin_output",
"log_plugin_output", "~~"))
+declare_filter(203, FilterText("log_type", _("Log: message type"),
"log", "log_type", "log_type", "~~"))
declare_filter(260, FilterText("log_contact_name", _("Log: contact
name"), "log", "log_contact_name",
"log_contact_name", "="),
_("Exact match, used for linking"))