Module: check_mk
Branch: master
Commit: fe635e8d4e9fa7f2e08e85e5fda5a09e469ddd78
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe635e8d4e9fa7…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Mar 23 10:33:34 2015 +0100
db2_connections: Fixed case of missing latency informations
---
checks/db2_connections | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/checks/db2_connections b/checks/db2_connections
index 25b9317..d724202 100644
--- a/checks/db2_connections
+++ b/checks/db2_connections
@@ -55,10 +55,11 @@ def check_db2_connections(item, params, parsed):
yield 0, "Connections: %s" % connections, [("connections",
connections)]
yield 0, "Port: %s" % data["port"]
- minutes, rest = data["latency"].split(":")
- seconds, mseconds = rest.split(".")
- ms = int(minutes) * 60 * 1000 + int(seconds) * 1000 + int(mseconds)
- yield 0, "Latency: %.2f ms" % ms, [("latency", ms)]
+ if "latency" in data:
+ minutes, rest = data["latency"].split(":")
+ seconds, mseconds = rest.split(".")
+ ms = int(minutes) * 60 * 1000 + int(seconds) * 1000 + int(mseconds)
+ yield 0, "Latency: %.2f ms" % ms, [("latency", ms)]
check_info['db2_connections'] = {
"parse_function" : parse_db2_dbs,