CUPS 1.3.5: Best method to receive notifications...subscriptions, mailto ?

Evan Bradley ebradley at williams-int.com
Mon Jan 21 07:24:51 PST 2008


> > Hello,
> >
> > I'm interested in receiving notifications via email or otherwise from CUPS when print queues go offline.  I see in the CUPS documentation that there are several ways to accomplish this, but I don't see any clear definition as to how to set this up.  There's the mailto.conf and subscription.conf files in /etc/cups/ but I don't really understand how CUPS uses these files to actually send the notifications.
> >
> > Our printers are currently setup as App Socket/Jet Direct (socket://PRINTER:9100) devices, but that might be changeable if need be.
> >
> > Could someone please point me in the right direction?  A weblink or an example or some other type of explanation would be greatly appreciated.
> >
> > Thanks,
> >
> >
> > Evan
>
> You can use this as an example:
>
> # cat mailto.conf
> From cups at cupserver
> Subject CUPS Notification
>
> # cat subscriptions.conf
> NextSubscriptionId 2
> <Subscription 1>
> Events job-completed
> Owner cups
> Recipient mailto:myname at mydomain.com
> PrinterName hplj4m
> LeaseDuration 0
> Interval 0
> ExpirationTime 0
> NextEventId 87
> </Subscription>
>
> Check the documentation for additional Events you want to be notified
> in.
>
> Thanks,
> Angel
>
>
>
Thanks Angel!

I modeled my conf files after yours and added a few other things I found in the documentation, however I still don't receive an email when I stop a printer's queue.  Have I forgotten something, or maybe added too much?

Here are my conf files:

# less /etc/cups/mailto.conf

SMTPServer emailserver.ourdomain.com
Cc Evan Bradley <myemail at ourdomain.com>
>From CUPS - Unix Printing <cupsserver at ourdomain.com>
Subject A CUPS print queue has stopped!


# less /etc/cups/subscriptions.conf

<Subscription 1>
PrinterName MISQ2
Events printer-stopped
Owner root
Recipient mailto:my_same_email_as_above at ourdomain.com
UserData mailto:my_same_email_as_above at purdomain.com
Interval 3600
ExpirationTime 0
LeaseDuration 0
NextEventId 999
</Subscription>


Here is the error log immediately after stopping the MISQ2 printer:

D [21/Jan/2008:10:14:59 +0500] cupsdAcceptClient: 12 from localhost (Domain)
D [21/Jan/2008:10:14:59 +0500] [CGI] http=3f200
D [21/Jan/2008:10:14:59 +0500] [CGI] op="stop-printer"...
D [21/Jan/2008:10:14:59 +0500] cupsdReadClient: 12 POST /admin/ HTTP/1.1
D [21/Jan/2008:10:14:59 +0500] cupsdAuthorize: No authentication data provided.
D [21/Jan/2008:10:14:59 +0500] Pause-Printer ipp://localhost/printers/MISQ2
D [21/Jan/2008:10:14:59 +0500] Discarding unused printer-stopped event...
I [21/Jan/2008:10:14:59 +0500] Saving printers.conf...
I [21/Jan/2008:10:14:59 +0500] Printer "MISQ2" stopped by "anonymous".
D [21/Jan/2008:10:14:59 +0500] cupsdProcessIPPRequest: 12 status_code=0 (successful-ok)

The line in the log that reads 'Discarding unused printer-stopped event...' doesn't look too promising.  :-\

Thanks in advance to anyone that can provide some insight...


Evan




More information about the cups mailing list