Module: check_mk
Branch: master
Commit: 5b79f08ad1e2078c7fd8a995331b38adf8b03ce0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5b79f08ad1e207…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Feb 22 11:02:25 2017 +0100
4409 FIX uptime: fixed missing info handling
Change-Id: I956e4ea9e38f777f2ab9e6a7345e6fa1fc24e990
---
.werks/4409 | 11 +++++++++++
ChangeLog | 1 +
checks/uptime | 7 +++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/4409 b/.werks/4409
new file mode 100644
index 0000000..3254cc5
--- /dev/null
+++ b/.werks/4409
@@ -0,0 +1,11 @@
+Title: uptime: fixed missing info handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487757735
+
+
diff --git a/ChangeLog b/ChangeLog
index 2e7f321..71f024e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 4406 FIX: Fixed some invalid keyword arguments in check_info declarations...
* 4408 FIX: checkpoint_temp, checkpoint_fan, checkpoint_voltage: fixed status and
value handling
* 4349 FIX: cisco_qos: Fix crashing check for some cases where the QoS class cannot
be found...
+ * 4409 FIX: uptime: fixed missing info handling
Multisite:
* 4365 FIX: Service availability: Host down could not be rewritten to other states
like CRIT
diff --git a/checks/uptime b/checks/uptime
index 921ee40..7769196 100644
--- a/checks/uptime
+++ b/checks/uptime
@@ -29,13 +29,16 @@
# <<<uptime>>>
# 15876.96 187476.72
+
def inventory_uptime(info):
if info:
return [ (None, {}) ]
+
def check_uptime(_no_item, params, info):
- uptime_sec = float(info[0][0])
- return check_uptime_seconds(params, uptime_sec)
+ if info:
+ uptime_sec = float(info[0][0])
+ return check_uptime_seconds(params, uptime_sec)
check_info["uptime"] = {