Module: check_mk
Branch: master
Commit: c461f250254c303059febda45ef4e419e5f184dc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c461f250254c30…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 17 18:40:37 2013 +0100
Added all active checks to check_mk -L output
check_mk -L did list all tcp and snmp based check, but the
active checks were missing. They have been added now.
---
.bugs/1084 | 7 +++++--
.bugs/827 | 7 +++++--
.bugs/920 | 7 +++++--
.werks/386 | 12 ++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 33 ++++++++++++++++++++++++---------
6 files changed, 52 insertions(+), 15 deletions(-)
diff --git a/.bugs/1084 b/.bugs/1084
index 8a0f62f..e2e8e69 100644
--- a/.bugs/1084
+++ b/.bugs/1084
@@ -1,9 +1,12 @@
Title: cmk -L should also list active checks
Component: checks
-State: open
+Class: nastiness
+State: done
Date: 2013-11-15 08:23:05
Targetversion: future
-Class: nastiness
cmk -L should not only list Check_MK based checks but also active
checks that can be configured via Check_MK, like check_http.
+
+2013-12-17 18:39:29: changed state open -> done
+Added active checks to -L output and improved formating of that table
diff --git a/.bugs/827 b/.bugs/827
index ea9f8d9..3ccb785 100644
--- a/.bugs/827
+++ b/.bugs/827
@@ -1,9 +1,9 @@
Title: Wato Folder creation from non admins
Component: wato
-State: open
+Class: nastiness
+State: done
Date: 2013-04-08 14:53:45
Targetversion: 1.2.3
-Class: nastiness
Ich/mein User ist nicht admin, hat aber Rechte im WATO-Ordner
Ich lege einen neuen WATO-Unterordner an, ohne dass ich spezielle
@@ -13,3 +13,6 @@ keine Rechte darauf.
Dies ist aber lediglich ein Anzeigefehler... ein Page-Reload reicht
schon... das Schloss verschwindet und die Vererbten Permissions werden
angezeigt - alles paletti!
+
+2013-12-17 18:17:46: changed state open -> done
+This should have been solved today.
diff --git a/.bugs/920 b/.bugs/920
index 59f474c..4a2b825 100644
--- a/.bugs/920
+++ b/.bugs/920
@@ -1,9 +1,9 @@
Title: Implement paged ldap search to fix problems with response size limits
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2013-04-29 10:22:57
Targetversion: 1.2.3
-Class: nastiness
At the moment we have only implemented a simple ldap search. In some directories,
like active directory it leads into a SIZE_LIMIT_EXCEEDED exception when
@@ -11,3 +11,6 @@ a query results in more than 1000 response objects.
The solution here is to implement a paged ldap search. An example can be
seen here:
http://www.novell.com/coolsolutions/tip/18274.html
+
+2013-12-17 18:15:52: changed state open -> done
+This has already been implemented a long time ago.
diff --git a/.werks/386 b/.werks/386
new file mode 100644
index 0000000..1808b98
--- /dev/null
+++ b/.werks/386
@@ -0,0 +1,12 @@
+Title: Added all active checks to check_mk -L output
+Level: 1
+Component: core
+Class: feature
+State: unknown
+Version: 1.2.5i1
+Date: 1387301984
+Targetversion: future
+
+check_mk -L did list all tcp and snmp based check, but the
+active checks were missing. They have been added now.
+
diff --git a/ChangeLog b/ChangeLog
index b3e0cb5..10f03c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
1.2.5i1:
Core & Setup:
+ * 0386 Added all active checks to check_mk -L output...
* 0087 FIX: Fixed possible locking issue when using datasource program with long
output...
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 5156294..0db56b6 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -450,30 +450,45 @@ if __name__ == "__main__":
def output_check_info():
print "Available check types:"
print
- print " plugin perf- in- "
- print "Name type data vent. service description"
+ print " plugin perf- in- "
+ print "Name type data vent. service
description"
print
"-------------------------------------------------------------------------"
- checks_sorted = check_info.items()
+ checks_sorted = check_info.items() + active_check_info.items()
checks_sorted.sort()
for check_type, check in checks_sorted:
try:
+ if 'command_line' in check:
+ what = 'active'
+ ty_color = tty_blue
+ elif check_uses_snmp(check_type):
+ what = 'snmp'
+ ty_color = tty_magenta
+ else:
+ what = 'tcp'
+ ty_color = tty_yellow
+
if check.get("has_perfdata", False):
p = tty_green + tty_bold + "yes" + tty_normal
else:
p = "no"
- if check["inventory_function"] == None:
+
+ if what == 'active':
+ i = '-'
+ elif check["inventory_function"] == None:
i = "no"
else:
i = tty_blue + tty_bold + "yes" + tty_normal
- if check_uses_snmp(check_type):
- typename = tty_magenta + "snmp" + tty_normal
+ if what == 'active':
+ descr = '-'
else:
- typename = tty_yellow + "tcp " + tty_normal
+ descr = check["service_description"]
- print (tty_bold + "%-19s" + tty_normal + " %s %-3s
%-3s %s") % \
- (check_type, typename, p, i, check["service_description"])
+ print (tty_bold + "%-32s" + tty_normal
+ + ty_color + " %-6s " + tty_normal
+ + " %-3s %-3s %s") % \
+ (check_type, what, p, i, descr)
except Exception, e:
sys.stderr.write("ERROR in check_type %s: %s\n" % (check_type, e))