Fixed exception when a file was found in quarantine
Message-ID: <54808aa7.lwlPUF6ECSjAd9/W%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 35210c8112ae9ff6c3f54137914aeb66febda8b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=35210c8112ae9f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 16:46:08 2014 +0100
#1652 FIX kaspersky_av_quarantine: Fixed exception when a file was found in quarantine
---
.werks/1652 | 9 +++++++++
ChangeLog | 1 +
checks/kaspersky_av_quarantine | 15 ++++++++-------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/.werks/1652 b/.werks/1652
new file mode 100644
index 0000000..937a50a
--- /dev/null
+++ b/.werks/1652
@@ -0,0 +1,9 @@
+Title: kaspersky_av_quarantine: Fixed exception when a file was found in quarantine
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417707947
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 0ff736b..58745f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -103,6 +103,7 @@
* 1647 FIX: agent_ipmi: Check_MK service gets critical now when ipmi-sensors command
fails
* 1453 FIX: drbd.stats: tried to send non-numeric write order parameter to rrd...
* 1598 FIX: bluecat_dhcp: Check is not longer found in inventory if dhcp service is
not activated
+ * 1652 FIX: kaspersky_av_quarantine: Fixed exception when a file was found in
quarantine
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/kaspersky_av_quarantine b/checks/kaspersky_av_quarantine
index eca9360..1289a59 100644
--- a/checks/kaspersky_av_quarantine
+++ b/checks/kaspersky_av_quarantine
@@ -25,21 +25,22 @@
# Boston, MA 02110-1301 USA.
# Example output from agent:
-#<<<kaspersky_quarantine:sep(58)>>>
-#Quarantine/backup statistics:
-# Objects: 0
-# Size: 0
-# Last added: unknown
+# <<<kaspersky_av_quarantine:sep(58)>>>
+# Quarantine/backup statistics:
+# Objects: 0
+# Size: 0
+# Last added: unknown
def inventory_kaspersky_av_quarantine(info):
return [( None, None )]
def check_kaspersky_av_quarantine(item, _no_params, info):
- info = dict(info)
+ # Reformat info when some lines have more than 2 elements
+ info = dict([ [l[0], ' '.join(l[1:])] for l in info ])
objects = int(info['Objects'])
perf = [ ( 'objects', objects ) ]
if objects > 0:
- return 2, " %d Objects in Quarantine. Last added: %s" % ( objects,
info['Last added'].strip() ), perf
+ return 2, "%d Objects in Quarantine, Last added: %s" % (objects,
info['Last added'].strip()), perf
return 0, "No objects in Quarantine", perf
check_info["kaspersky_av_quarantine"] = {