Module: check_mk
Branch: master
Commit: 422854522f49f64496235f1d50ffbaf965386a3e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=422854522f49f6…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 3 10:54:31 2016 +0200
3527 FIX WATO service discovery: fixed warning with locked hosts
Starting a single or a bulk discovery on locked hosts no longer raises a warning
when WATO tries to modify an attribute concerning a failed service discovery.
---
.werks/3527 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 11 ++++++++++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.werks/3527 b/.werks/3527
new file mode 100644
index 0000000..d40a00f
--- /dev/null
+++ b/.werks/3527
@@ -0,0 +1,11 @@
+Title: WATO service discovery: fixed warning with locked hosts
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462265466
+
+Starting a single or a bulk discovery on locked hosts no longer raises a warning
+when WATO tries to modify an attribute concerning a failed service discovery.
diff --git a/ChangeLog b/ChangeLog
index d2d405b..589af70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -341,6 +341,7 @@
* 3458 FIX: Bulk edit: Fixed broken unchecking of attributes after complain
* 3459 FIX: Bulk edit: Fixed mixup of attributes during consecutive bulk edits
* 3461 FIX: Fixed exception in case manpage for non existant check is accessed
+ * 3527 FIX: WATO service discovery: fixed warning with locked hosts...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3759d12..c0ce104 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2659,8 +2659,13 @@ def mode_inventory(phase, firsttime):
if html.var("_refresh"):
counts, failed_hosts = check_mk_automation(host.site_id(),
"inventory", [ "@scan", "refresh", hostname ])
count_added, count_removed, count_kept, count_new = counts[hostname]
+
message = _("Refreshed check configuration of host [%s] with %d
services") % \
(hostname, count_added)
+
+ if not host.locked():
+ host.clear_discovery_failed()
+
log_pending(LOCALRESTART, hostname, "refresh-autochecks",
message)
else:
@@ -2682,9 +2687,13 @@ def mode_inventory(phase, firsttime):
active_checks[(ct, item)] = paramstring
check_mk_automation(host.site_id(), "set-autochecks",
[hostname], active_checks)
- host.clear_discovery_failed()
+
message = _("Saved check configuration of host [%s] with %d
services") % \
(hostname, len(active_checks))
+
+ if not host.locked():
+ host.clear_discovery_failed()
+
log_pending(LOCALRESTART, hostname, "set-autochecks", message)
host.mark_dirty(need_sync=False)