Module: check_mk
Branch: master
Commit: 288ad95695afb2a5c4ffb2af00720fa8822c7f6c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=288ad95695afb2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 16 20:21:13 2017 +0200
livestatus: Added some error handling (Trying to track down multi site connect issue)
Change-Id: Ia92fd9326575ba27d5f17f7609b0b654639c39fd
---
web/htdocs/sites.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/sites.py b/web/htdocs/sites.py
index 837423d..4383fcd 100644
--- a/web/htdocs/sites.py
+++ b/web/htdocs/sites.py
@@ -153,7 +153,19 @@ def _connect_multiple_sites():
"Cache: reload\n"
"Columns: livestatus_version program_version program_start num_hosts
num_services"):
- site_id, v1, v2, ps, num_hosts, num_services = response
+ try:
+ site_id, v1, v2, ps, num_hosts, num_services = response
+ except ValueError:
+ e = livestatus.MKLivestatusQueryError(
+ "Invalid response to status query: %s" % response)
+
+ site_id = response[0]
+ _update_site_status(site_id, {
+ "exception" : e,
+ "status_host_state" : None,
+ "state" : _status_host_state_name(None),
+ })
+ continue
_update_site_status(site_id, {
"state" : "online",