Module: check_mk
Branch: master
Commit: 7575f6df5402533d19a8c31e8000a4673905b419
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7575f6df540253…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Sep 30 18:30:58 2013 +0200
fixing bug #1052: cups default printer is now monitored again with linux agent
---
ChangeLog | 1 +
agents/check_mk_agent.linux | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b3b6c09..304d8c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Checks & Agents:
* windows_agent: increased maximum plugin output buffer size to 2MB
* FIX: windows_agent: fixed bug in cleanup of open thread handles
+ * FIX: cups default printer is now monitored again in linux agent
Multisite:
* FIX: ldap attribute plugins: fixed crash when parameters are None
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index cdf452f..e76e27c 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -363,13 +363,14 @@ if type lpstat > /dev/null 2>&1; then
echo '<<<cups_queues>>>'
WAITMAX="waitmax 3"
CPRINTCONF=/etc/cups/printers.conf
+ PRINTERS=$(lpstat -a | awk '{print $1}')
if [ -r "$CPRINTCONF" ] ; then
- for PQ in $(lpstat -a | awk '{print $1}') ; do
- grep -q -x -F "<Printer $PQ>" $CPRINTCONF &&
$WAITMAX lpstat -p $PQ
+ for PQ in $PRINTERS ; do
+ grep -q -x -E "<(Default)?Printer $PQ>" $CPRINTCONF
&& $WAITMAX lpstat -p $PQ
done
echo '---'
- for PQ in $(lpstat -a | awk '{print $1}') ; do
- grep -q -x -F "<Printer $PQ>" $CPRINTCONF &&
$WAITMAX lpstat -o $PQ
+ for PQ in $PRINTERS ; do
+ grep -q -x -E "<(Default)?Printer $PQ>" $CPRINTCONF
&& $WAITMAX lpstat -o $PQ
done
else
$WAITMAX lpstat -p ; echo '---' ; $WAITMAX lpstat -o | sort