Module: check_mk
Branch: master
Commit: 96486567b6d21b5d58b11830bd14a04d0373d8ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96486567b6d21b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 13 10:43:48 2011 +0100
Multisite: new column for comments
---
ChangeLog | 2 ++
web/.f12 | 2 +-
web/plugins/views/painters.py | 23 +++++++++++++++++++++++
3 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2269d58..2ed206e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
Multisite:
* New reschedule icon now also works for non-local sites.
* painter options are now persisted on a per-user-base
+ * new optional column for displaying host and service comments
+ (not used in shipped views but available in view editor)
Livestatus:
* Check for buffer overflows (replace strcat with strncat, etc.)
diff --git a/web/.f12 b/web/.f12
index c49acf6..8c90ab2 100644
--- a/web/.f12
+++ b/web/.f12
@@ -1,2 +1,2 @@
sudo cp -prv * /omd/versions/default/share/check_mk/web/
-sudo su - -c 'omd reload eins apache'
+sudo su - -c 'omd reload wato apache'
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 9e13488..e440a6b 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -603,6 +603,21 @@ multisite_painters["check_manpage"] = {
"paint" : paint_check_manpage
}
+def paint_comments(prefix, row):
+ comments = row[ prefix + "comments_with_info"]
+ text = ", ".join(["<i>%s</i>: %s" % (a,c) for
(id,a,c) in comments ])
+ return "", text
+
+multisite_painters["svc_comments"] = {
+ "title" : "Service Comments",
+ "short" : "Comments",
+ "columns" : [ "service_comments_with_info" ],
+ "paint" : lambda row: paint_comments("service_", row)
+}
+
+
+
+
def notes_matching_pattern_entries(dirs, item):
from fnmatch import fnmatch
matching = []
@@ -1014,6 +1029,14 @@ multisite_painters["host_tags"] = {
"paint" : paint_host_tags
}
+multisite_painters["host_comments"] = {
+ "title" : "Host Comments",
+ "short" : "Comments",
+ "columns" : [ "host_comments_with_info" ],
+ "paint" : lambda row: paint_comments("host_", row)
+}
+
+
# _ _ _
# | | | | ___ ___| |_ __ _ _ __ ___ _ _ _ __ ___
# | |_| |/ _ \/ __| __/ _` | '__/ _ \| | | | '_ \/ __|