Module: check_mk
Branch: master
Commit: f0ab03d2569a51bcbbbf3cd8051c140fb9d29859
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0ab03d2569a51…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Dec 12 21:07:38 2016 +0100
4160 FIX apt: Fixed crash on unexpected output
Fixed crash if line does not start with "Inst".
Change-Id: If14dfdf9748402f64863c53337baf9b9aa7058f8
---
.werks/4160 | 8 ++++----
ChangeLog | 2 +-
checks/apt | 2 ++
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/.werks/4160 b/.werks/4160
index 9a4d708..32ce35a 100644
--- a/.werks/4160
+++ b/.werks/4160
@@ -1,10 +1,10 @@
-Title: emcvnx_info: fixed data handling, now detects errors
+Title: apt: Fixed crash on unexpected output
Level: 1
Component: checks
-Class: fix
Compatible: compat
-State: unknown
Version: 1.4.0i3
-Date: 1481550183
+Date: 1481573187
+Class: fix
+Fixed crash if line does not start with "Inst".
diff --git a/ChangeLog b/ChangeLog
index 180e432..6b31573 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,12 +60,12 @@
* 4158 FIX: fileinfo: fixed file handling containing spaces
* 4101 FIX: citrix_sessions: Output error message in case of missing session
information....
* 4102 FIX: logwatch: Fixed crash due to non-existant logfile...
- * 4160 FIX: emcvnx_info: fixed data handling, now detects errors
* 4161 FIX: emcvnx_sp_util: fixed empty data handling
* 4162 FIX: esx_vsphere_vm.heartbeat: fixed KeyError
* 4163 FIX: kernel: fixed empty data handling
* 4164 FIX: livestatus_status: fixed ValueError for values in scientific notation
* 4103 FIX: kaspersky_av_client: No longer crash when date of last full scan is
unknown...
+ * 4160 FIX: apt: Fixed crash on unexpected output...
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/apt b/checks/apt
index c9bb04e..a931211 100644
--- a/checks/apt
+++ b/checks/apt
@@ -70,6 +70,8 @@ def check_apt(_no_item, params, info):
updates = []
sec_updates = []
for line in info:
+ if not line[0].startswith("Inst"):
+ continue
inst, packet, version, hints = line[0].split(None, 3)
if sec_regex.match(line[0]):
sec_updates.append(packet)