[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can you check program output? (to monitor CUPS printers)

From: Adam Nielsen
Subject: Re: Can you check program output? (to monitor CUPS printers)
Date: Tue, 09 Nov 2010 10:21:13 +1000
User-agent: Thunderbird (X11/20091130)

Sorry, forgot to post a followup on this!

Occasionally we get a print job which makes CUPS break, and it takes
printer offline until the job is deleted and an admin logs in and
restarts the queue.  I would like monit to keep an eye on this and when
it happens, clear the print queue and restart the printer

I do this without monit. Run a script from cron every x minutes. If it detects 
an offline printer, it restarts cups and only then generates output/sends an 

Thanks for the suggestion, this works well. For reference, this is the script I run from cron every couple of minutes:


PRINTERS=`/usr/bin/lpstat -a | cut -d ' ' -f 1`

for I in $PRINTERS; do
        if /usr/bin/lpstat -p $I | grep -q disabled; then
                /usr/sbin/cupsenable -c $I
                echo "Re-enabled CUPS print queue $I"

The 'echo' makes cron send the e-mail whenever a print queue had to be restarted.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]