Module: check_mk
Branch: master
Commit: ecc5280b3f1d97133a9ec35b0113b75121cb4ece
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ecc5280b3f1d97…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon May 27 16:32:29 2013 +0200
lnx_if: Fixed crash on missing 'Address' field
---
ChangeLog | 4 +++-
checks/lnx_if | 8 ++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4002b88..1aeb326 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
1.2.3i2:
Core:
* New option -B for just generating the configuration
-
+
+ Checks & Agents:
+ * lnx_if: Fixed crash on missing "Address" field
1.2.3i1:
Core:
diff --git a/checks/lnx_if b/checks/lnx_if
index 516407a..2ccb3d7 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -130,10 +130,10 @@ def if_lnx_convert_to_if64(info):
else:
ifOperStatus = 4 # unknown (NIC has never been used)
- # There is no mac adress data available for the moment
- def hextobin(x):
- return chr(int(x, 16))
- ifPhysAddress = "".join([chr(int(x, 16)) for x in
attr.get("Address", "").split(":")])
+ if attr.get("Address"):
+ ifPhysAddress = "".join([chr(int(x, 16)) for x in
attr.get("Address", "").split(":")])
+ else:
+ ifPhysAddress = ''
if_table.append(map(str, [
ifIndex, ifDescr, ifType, ifSpeed, ifOperStatus,