Module: check_mk
Branch: master
Commit: 6fe18e1d6a64c628d506d32fc1148946d2c523ad
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6fe18e1d6a64c6…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed May 24 16:27:21 2017 +0200
4743 FIX f5_bigip_conns: Fixed crash if empty values
Change-Id: I1bbacff538da617f962a8cdb34e4105cc80764e4
---
.werks/4743 | 10 ++++++++++
checks/f5_bigip_conns | 20 ++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/.werks/4743 b/.werks/4743
new file mode 100644
index 0000000..10e163e
--- /dev/null
+++ b/.werks/4743
@@ -0,0 +1,10 @@
+Title: f5_bigip_conns: Fixed crash if empty values
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495636008
+Class: fix
+
+
diff --git a/checks/f5_bigip_conns b/checks/f5_bigip_conns
index f9dc011..086407d 100644
--- a/checks/f5_bigip_conns
+++ b/checks/f5_bigip_conns
@@ -38,17 +38,29 @@ def inventory_f5_bigip_conns(info):
def check_f5_bigip_conns(item, params, info):
+ print info
# Connection rate
now = time.time()
total_native_compat_rate = 0
conns_dict = {}
for line in info:
- native_conn_rate = get_rate("native", now, int(line[2]))
- compat_conn_rate = get_rate("compat", now, int(line[3]))
- total_native_compat_rate += native_conn_rate + compat_conn_rate
+ if line[2] != "":
+ native_conn_rate = get_rate("native", now, int(line[2]))
+ else:
+ native_conn_rate = 0
+
+ if line[3] != "":
+ compat_conn_rate = get_rate("compat", now, int(line[3]))
+ else:
+ compat_conn_rate = 0
- stat_http_req_rate = get_rate("stathttpreqs", now, int(line[4]))
+ total_native_compat_rate += native_conn_rate + compat_conn_rate
+
+ if line[4] != "":
+ stat_http_req_rate = get_rate("stathttpreqs", now, int(line[4]))
+ else:
+ stat_http_req_rate = None
if line[0] != "":
conns_dict.setdefault("total", 0)