Module: check_mk
Branch: master
Commit: 5ea7a0081fc3d014376931767c0279d2f6fb8c4c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ea7a0081fc3d0…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Apr 28 15:20:02 2016 +0200
3241 FIX Fixed broken apt plugin
---
.werks/3241 | 10 ++++++++++
ChangeLog | 1 +
agents/plugins/mk_apt | 9 +++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.werks/3241 b/.werks/3241
new file mode 100644
index 0000000..3ff85a2
--- /dev/null
+++ b/.werks/3241
@@ -0,0 +1,10 @@
+Title: Fixed broken apt plugin
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461849557
+
+
diff --git a/ChangeLog b/ChangeLog
index d66279f..4cfb241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -198,6 +198,7 @@
* 3443 FIX: mk_logwatch: Fixed exception in agent plugin configuration parsing error
handling
* 3444 FIX: mssql: Reworked agent plugin to use less WMI calls
* 3525 FIX: Nagios Core: fixed bug, incomplete cleanup of process tree on service
check timeout...
+ * 3241 FIX: Fixed broken apt plugin
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/plugins/mk_apt b/agents/plugins/mk_apt
index 19369de..c4ded2d 100755
--- a/agents/plugins/mk_apt
+++ b/agents/plugins/mk_apt
@@ -43,7 +43,12 @@ DO_UPDATE=yes
function check_apt_update {
if [ "$DO_UPDATE" = yes ] ; then
- apt-get update -qq
+ # NOTE: Even with -qq, apt-get update can output several lines to
+ # stderr, e.g.:
+ #
+ # W: There is no public key available for the following key IDs:
+ # 1397BC53640DB551
+ apt-get update -qq 2> /dev/null
fi
apt-get -o 'Debug::NoLocking=true' -s -qq "$UPGRADE" | grep -v
'^Conf'
}
@@ -52,7 +57,7 @@ function check_apt_update {
if type apt-get > /dev/null ; then
echo '<<<apt:sep(0)>>>'
out=$(check_apt_update)
- if [ -z $out ]; then
+ if [ -z "$out" ]; then
echo "No updates pending for installation"
else
echo "$out"