Module: check_mk
Branch: master
Commit: 047b2175bd34df90f8404ae9332a053a5a8b155b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=047b2175bd34df…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 9 09:44:12 2014 +0100
#1727 FIX cisco_secure: Fixed inventory exception when port security is not enabled
---
.werks/1727 | 9 +++++++++
ChangeLog | 1 +
checks/cisco_secure | 4 +++-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/1727 b/.werks/1727
new file mode 100644
index 0000000..cab7e98
--- /dev/null
+++ b/.werks/1727
@@ -0,0 +1,9 @@
+Title: cisco_secure: Fixed inventory exception when port security is not enabled
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418114616
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index f770d56..be00b28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -137,6 +137,7 @@
* 1695 FIX: brocade_vdx_status: Is now not bein inventorized anymore for devices not
supporting the check
* 1722 FIX: lnx_thermal: fix invalid zero temperature if mode file is missing
* 1696 FIX: cisco_temp_sensor: Value reported of check was not always correct
(precision was wrong)...
+ * 1727 FIX: cisco_secure: Fixed inventory exception when port security is not
enabled
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/cisco_secure b/checks/cisco_secure
index 898082d..04317c6 100644
--- a/checks/cisco_secure
+++ b/checks/cisco_secure
@@ -31,7 +31,9 @@ def parse_cisco_secure(info):
names = dict([ (l[0], ( l[1], l[2] )) for l in info[0]] )
for num, enabled, status, violationCount, lastmac in info[1]:
mac = ":".join(["%02s" % hex(ord(m))[2:] for m in
lastmac]).replace(' ', '0')
- parsed.append(( names[num][0], int(names[num][1]), int(enabled), int(status),
int(violationCount), mac ))
+ # violationCount is initialized with 0 when security is enabled. When not, the
+ # value is reported as empty string. saveint() makes life easier here.
+ parsed.append((names[num][0], int(names[num][1]), int(enabled), int(status),
saveint(violationCount), mac))
return parsed