Module: check_mk
Branch: master
Commit: 1ca9bb21b4420833c60a0da72f82d6cff73eb53d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ca9bb21b44208…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 12 09:38:27 2016 +0200
Added helper function to get full host state names
---
lib/defines.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/defines.py b/lib/defines.py
index 130d7de..206677a 100644
--- a/lib/defines.py
+++ b/lib/defines.py
@@ -66,6 +66,15 @@ def short_service_state_name(state_num, deflt=""):
return states.get(state_num, deflt)
+def host_state_name(state_num, deflt=""):
+ states = {
+ 0: _("UP"),
+ 1: _("DOWN"),
+ 2: _("UNREACHABLE"),
+ }
+ return states.get(state_num, deflt)
+
+
def short_host_state_name(state_num, deflt=""):
states = {
0: _("UP"),