Module: check_mk
Branch: master
Commit: 02b2e2bab251890f992f4c0da2f431681edeb438
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=02b2e2bab25189…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 16 12:29:15 2012 +0200
FIX: Automation Try-Inventory: Fixed problem on where checks which
produce equal service descriptions could lead to invalid inventory
results on cluster hosts.
---
.bugs/692 | 37 +++++++++++++++++++++++++++++++++++++
ChangeLog | 3 +++
modules/automation.py | 9 +++++----
3 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/.bugs/692 b/.bugs/692
new file mode 100644
index 0000000..03b4ed9
--- /dev/null
+++ b/.bugs/692
@@ -0,0 +1,37 @@
+Title: Fehler bei Inventory via WATO (fs_* Services von df Check werden nicht gefunden)
+Component: wato
+Class: bug
+State: done
+Date: 2012-04-16 12:11:13
+Targetversion: future
+
+Beim Aufruf der Service Inventur im WATO bekommt man mit den "(cached data)"
folgendes:
+
+Available (missing) services
+df /mirrored/monitoring fs_/mirrored/monitoring OK
+OK df /mirrored/syslog fs_/mirrored/syslog OK
+
+Beim Klick auf "Full Scan" sieht man diese Services nicht mehr:
+
+Already configured services
+Status Checktype Item Service Description Current check
+OK df /mirrored/ldap fs_/mirrored/ldap
+OK mounts /mirrored/ldap Mount options of /mirrored/ldap
+OK mounts /mirrored/monitoring Mount options of /mirrored/monitoring
+OK mounts /mirrored/syslog Mount options of /mirrored/syslog
+
+Ignored services (configured away by admin)
+Status Checktype Item Service Description Current check
+OK hr_fs /mirrored/monitoring fs_/mirrored/monitoring
+OK hr_fs /mirrored/monitoring/sites/vtr_whvvtr/tmp
fs_/mirrored/monitoring/sites/vtr_whvvtr/tmp
+OK hr_fs /mirrored/syslog fs_/mirrored/syslog
+
+Vermutung: hr_fs erzeugt die gleichen Service Descriptions und steht auf ignore.
Überdecken die
+Services womöglich die Services von df?
+
+Hier geht es um einen Cluster Host. Eventuell ist das ein Spezialproblem von Clustern.
+
+EDIT: Der Fehler kommt aus cmk --automation try-inventory.
+
+2012-04-16 12:24:31: changed state open -> done
+Bei Cluster Hosts gibt es eine Sonderbehandlung. Dort wurde nur die Service-Description
behandelt.
diff --git a/ChangeLog b/ChangeLog
index 2941c11..75d6c9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1.2.0b2:
Core:
* FIX: Cluster host checks were UNKNOWN all the time
+ * FIX: Automation Try-Inventory: Fixed problem on where checks which
+ produce equal service descriptions could lead to invalid inventory
+ results on cluster hosts.
WATO:
* Added new permission "move hosts" to allow/deny moving of hosts in WATO
diff --git a/modules/automation.py b/modules/automation.py
index 00059cf..3a3240e 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -146,14 +146,15 @@ def automation_try_inventory(args):
# services of that cluster.
services = []
if is_cluster(hostname):
- descriptions = set([])
+ already_added = set([])
for node in nodes_of(hostname):
new_services = automation_try_inventory_node(node)
for entry in new_services:
if host_of_clustered_service(node, entry[6]) == hostname:
- if entry[6] not in descriptions:
+ # 1: check, 6: Service description
+ if (entry[1], entry[6]) not in already_added:
services.append(entry)
- descriptions.add(entry[6]) # make it unique
+ already_added.add((entry[1], entry[6])) # make it unique
else:
new_services = automation_try_inventory_node(hostname)
@@ -163,7 +164,7 @@ def automation_try_inventory(args):
return services
-
+
def automation_try_inventory_node(hostname):
global opt_use_cachefile, opt_no_tcp, opt_dont_submit