Module: check_mk
Branch: master
Commit: 5f7c234a56f5ff9f78e02da62b3dec451b7c4893
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f7c234a56f5ff…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 24 22:30:55 2010 +0100
Multisite: improve handling of invalid status hosts
---
web/htdocs/index.py | 2 +-
web/htdocs/livestatus.py | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index bc682b8..c6b0cc8 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -111,7 +111,7 @@ 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", 4:"unknown" }.get(shs)
+ statename = { 1:"down", 2:"unreach",
3:"waiting", }.get(shs, "unknown")
html.site_status[sitename]["state"] = statename
else:
diff --git a/web/htdocs/livestatus.py b/web/htdocs/livestatus.py
index 404e28c..a95ae87 100644
--- a/web/htdocs/livestatus.py
+++ b/web/htdocs/livestatus.py
@@ -183,7 +183,8 @@ class BaseConnection:
# Create new socket
self.socket = None
- parts = self.socketurl.split(":")
+ url = self.socketurl
+ parts = url.split(":")
if parts[0] == "unix":
if len(parts) != 2:
raise MKLivestatusConfigError("Invalid livestatus unix url: %s.
"