Module: check_mk
Branch: master
Commit: e6a8c5aebf49ad4630e51baebf2bad792764b995
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e6a8c5aebf49ad…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 9 15:10:39 2015 +0100
#1806 FIX services check was not recognizing configured state when no service was found
---
.werks/1806 | 10 ++++++++++
ChangeLog | 1 +
checks/services | 5 ++---
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.werks/1806 b/.werks/1806
new file mode 100644
index 0000000..64bfeaa
--- /dev/null
+++ b/.werks/1806
@@ -0,0 +1,10 @@
+Title: services check was not recognizing configured state when no service was found
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1420812618
+
+
diff --git a/ChangeLog b/ChangeLog
index 6572cb7..e0fa59f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,7 @@
NOTE: Please refer to the migration notes!
* 1833 FIX: jolokia_metrics.gc: fix recently introduced exception for missing
variable
* 1463 FIX: juniper_screenos_mem, juniper_trpz_mem: pnp template fixed
+ * 1806 FIX: services check was not recognizing configured state when no service was
found
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/services b/checks/services
index 4ffaaf7..49d72a9 100644
--- a/checks/services
+++ b/checks/services
@@ -198,9 +198,8 @@ def check_windows_services(item, params, info):
start_type = "unknown"
found.append((line[0], state, start_type, " ".join(line[3:])))
- if len(found) == 0:
- return (3, "service not found")
-
+ if not found:
+ return params["else"], "service not found"
# We take the best found state (neccessary for clusters)
best_state = None