Module: check_mk
Branch: master
Commit: 20ce3a8295109f3d191cf716591d145ba7bc4157
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=20ce3a8295109f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 19 13:52:10 2014 +0100
#1793 FIX fritz: avoid Exception in inventory function of fritz checks if agent output is
empty
---
.werks/1793 | 10 ++++++++++
ChangeLog | 1 +
checks/fritz | 10 ++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/1793 b/.werks/1793
new file mode 100644
index 0000000..c8a6fc4
--- /dev/null
+++ b/.werks/1793
@@ -0,0 +1,10 @@
+Title: fritz: avoid Exception in inventory function of fritz checks if agent output is
empty
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1418993501
+
+
diff --git a/ChangeLog b/ChangeLog
index dc3aaff..59fc696 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 1771 FIX: domino_mailqueues: Fixed exception during inventory when no data usable
data available
* 1208 FIX: cifsmounts: Detects now unreachable CIFS mounts
* 1772 FIX: lparstat_aix: Check handles already working agent output again
+ * 1793 FIX: fritz: avoid Exception in inventory function of fritz checks if agent
output is empty
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/fritz b/checks/fritz
index 62dc40e..751cb62 100644
--- a/checks/fritz
+++ b/checks/fritz
@@ -122,7 +122,9 @@ check_info['fritz.config'] = {
#
def fritz_wan_if_to_if64(data):
- if data['NewLinkStatus'] == 'Up':
+ if 'NewLinkStatus' not in data:
+ oper_status = None
+ elif data['NewLinkStatus'] == 'Up':
oper_status = '1'
else:
oper_status = '2'
@@ -131,9 +133,9 @@ def fritz_wan_if_to_if64(data):
# ifIndex, ifDescr, ifType, ifSpeed, ifOperStatus, ifInOctets, inucast,
# inmcast, inbcast, ifInDiscards, ifInErrors, ifOutOctets, outucast,
# outmcast, outbcast, ifOutDiscards, ifOutErrors, ifOutQLen, ifAlias,
ifPhysAddress
- ('0', 'WAN', '6',
data['NewLayer1DownstreamMaxBitRate'], oper_status,
- data['NewTotalBytesReceived'], '0', '0', '0',
'0', '0',
- data['NewTotalBytesSent'], '0', '0', '0',
'0', '0', '0',
+ ('0', 'WAN', '6',
data.get('NewLayer1DownstreamMaxBitRate'), oper_status,
+ data.get('NewTotalBytesReceived'), '0', '0',
'0', '0', '0',
+ data.get('NewTotalBytesSent'), '0', '0',
'0', '0', '0', '0',
'WAN', '')
]