Module: check_mk
Branch: master
Commit: 1984d1e45044dfda19e71b01f8370567050cb3e6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1984d1e45044df…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 20 08:37:09 2011 +0200
<<<cups_queue>>>: run agent section only on CUPS servers
---
ChangeLog | 2 ++
agents/check_mk_agent.linux | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e88f145..f58ccab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
Checks & Agents:
* FIX: j4p_performance: fix inventory functions
* mrpe: make check cluster-aware and work as clustered_service
+ * cups_queues: Run agent part only on directly on CUPS servers,
+ not on clients
Multisite:
* FIX: fix rescheduling of host check
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index b08b1f8..a985ff4 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -316,14 +316,14 @@ if [ -e /proc/drbd ]; then
cat /proc/drbd
fi
-# Checks for cups monitoring
+# Status of CUPS printer queues
if which lpstat > /dev/null 2>&1; then
- echo '<<<cups_queues>>>'
- waitmax 3 lpstat -p
- echo '---'
- for i in $(waitmax 3 lpstat -p | grep -E "^(printer|Drucker)" | awk
'{print $2}' | grep -v "@"); do
- waitmax 3 lpstat -o "$i"
- done
+ if pgrep cups > /dev/null 2>&1; then
+ echo '<<<cups_queues>>>'
+ waitmax 3 lpstat -p
+ echo '---'
+ waitmax 3 lpstat -o|sort
+ fi
fi
# Heartbeat monitoring