Module: check_mk
Branch: master
Commit: 2a6e691379ace0507377e217d39ac00bed5cddd7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a6e691379ace0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 3 14:07:38 2011 +0100
Multisite: correctly show dead Livestatus connections
in case the connect fails and there is no status host.
---
web/htdocs/index.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 8146d3a..095a8fa 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -128,7 +128,10 @@ def connect_to_livestatus(html):
html.site_status[sitename]["exception"] =
deadinfo["exception"]
shs = deadinfo.get("status_host_state")
html.site_status[sitename]["status_host_state"] = shs
- statename = { 1:"down", 2:"unreach",
3:"waiting", }.get(shs, "unknown")
+ if shs == None:
+ statename = "dead"
+ else:
+ statename = { 1:"down", 2:"unreach",
3:"waiting", }.get(shs, "unknown")
html.site_status[sitename]["state"] = statename
else: