Module: check_mk
Branch: master
Commit: 34f7ccd8da7079b6dbf563e501b9e9145d1ae988
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34f7ccd8da7079…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Jan 20 09:56:53 2014 +0100
FIX endless waiting for printer queues fixed
When checking the cups printer queues, the agent execution could take very long
if a machine has many many printers. Fixed this by executing the lpstat command
with a timeout.
---
.werks/460 | 10 ++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/460 b/.werks/460
new file mode 100644
index 0000000..6f30bea
--- /dev/null
+++ b/.werks/460
@@ -0,0 +1,10 @@
+Title: endless waiting for printer queues fixed
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1390207997
+Class: fix
+
+When checking the cups printer queues, the agent execution could take very long
+if a machine has many many printers. Fixed this by executing the lpstat command
+with a timeout.
diff --git a/ChangeLog b/ChangeLog
index 3690dbc..8e1b826 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -117,6 +117,7 @@
* 0567 FIX: apc_symmetra: transformation from old tuple to new dict format fixed and
improved
* 0432 FIX: stulz_humidity: Fixed syntax error...
* 0120 FIX: stulz_humidity, apc_humidity: Fixed bug while processing check params...
+ * 0460 FIX: endless waiting for printer queues fixed...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 25132f5..241d01a 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -369,7 +369,7 @@ 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}')
+ PRINTERS=$(waitmax 10 lpstat -a | awk '{print $1}')
if [ -r "$CPRINTCONF" ] ; then
for PQ in $PRINTERS ; do
grep -q -x -E "<(Default)?Printer $PQ>" $CPRINTCONF
&& $WAITMAX lpstat -p $PQ