Module: check_mk
Branch: master
Commit: 5915487a0f47ae991bdee90490e22aa50e5ae310
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5915487a0f47ae…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Mar 17 14:53:57 2016 +0100
3238 FIX if.include: Fixed handling of old-skool traffic limits
---
.werks/3238 | 10 ++++++++++
ChangeLog | 1 +
checks/if.include | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/3238 b/.werks/3238
new file mode 100644
index 0000000..546f4c0
--- /dev/null
+++ b/.werks/3238
@@ -0,0 +1,10 @@
+Title: if.include: Fixed handling of old-skool traffic limits
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458222777
+
+
diff --git a/ChangeLog b/ChangeLog
index 191c8a7..290a20a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,6 +87,7 @@
* 3009 FIX: ESX agent: fixed exception with utf-8 encoded strings...
* 3010 FIX: Fixed vanished snmp subchecks for snmp hosts...
* 3237 FIX: brocade_vdx_status: Fixed broken discovery
+ * 3238 FIX: if.include: Fixed handling of old-skool traffic limits
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/if.include b/checks/if.include
index fe3b795..edb20f3 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -136,7 +136,9 @@ def if_get_traffic_levels(params):
new_traffic = []
if 'traffic' in params and type(params['traffic']) != list:
warn, crit = params['traffic']
- if type(warn) == int:
+ if warn == None:
+ new_traffic.append(('both', ('upper', (None, (None,
None)))))
+ elif type(warn) == int:
new_traffic.append(('both', ('upper', ('abs', (warn,
crit)))))
elif type(warn) == float:
new_traffic.append(('both', ('upper', ('perc', (warn,
crit)))))