ink and toner level with cups

Aesis informatica aesis.info at email.it
Fri Jan 7 06:16:09 PST 2011


Thanks a lot Tim. I write this small application and i hope that work very well.
Best regards. Samuele Aesis.



>
> --=-bKp1icTkdhfPmM+0fZq6
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> On Fri, 2011-01-07 at 02:47 -0800, Aesis informatica wrote:
> > is there a way to see inside the cup of the printers toner level and
> > send an email when the toner is about to end?
>
> Although CUPS has a method for sending emails about certain situations
> (e.g. job aborted), this isn't one of those situations.
>
> However, you could write a small application to periodically check for
> the 'marker-supply' state reasons, marker-supply-low-warning and
> marker-supply-empty-error.
>
> In Python it can be checked like:
>
> import cups
> c=3Dcups.Connection ()
> for printer in c.getPrinters ():
>     for reason in printer.get ('printer-state-reasons', []):
>         if reason.startswith ('marker-supply'):
>             # This printer is low on ink/toner
>             break
>
> Tim.
> */
>
>
> --=-bKp1icTkdhfPmM+0fZq6
> Content-Type: application/pgp-signature; name="signature.asc"
> Content-Description: This is a digitally signed message part
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iD8DBQBNJvGkBLQafZpK2tcRAmAiAJ0dT93AIkRzPBZ9jv6+OuPqD1ARugCglB6q
> V1uFO9NayeU7hEIi6EGF3a8=
> =JSWD
> -----END PGP SIGNATURE-----
>
> --=-bKp1icTkdhfPmM+0fZq6--
>





More information about the cups mailing list