skip to content

Department of Genetics


It's useful to know when a printer is running out of toner...


PRINTER_POLL(1) User Contributed Perl Documentation PRINTER_POLL(1)

NAME - Get printer status and store it in a sqlite db

SYNOPSIS [options]

-add <name> -ip <ip> -contact <email>[,email...] [-bw_count oid]
[-col_count oid] [-tot_count oid]
-delete <id>
-chart <id> (disabled)

-add Add a printer to the database by name

-ip IP of printer (required)

-community SNMPv1 community (defaults to public)

-contact Comma separated email addresses (required)

-bw_count Numeric OID for BW counter

-col_count Numeric OID for colour counter

-tot_count Numeric OID for overall page counter

-chart (disabled)
Plot consumable status over time for a specific printer id

-db Specify database file

-delete Delete a printer by id

-dump Export consumable history as TSV

-help Show full help

-initdb Initialise database

-list List known printers

-counts Dump the current pagecounts

-usage Show usage info

This script will poll a set of printers for their status and save it in
a database.

It will send a simgle email alert to a stored email address if a con‐
sumable level drops below 10%


Polling Part

For each printer

  1. Get and store consumable levels.
  2. For each consumable
    1. Convert to percentage
    2. If the percentage is less than 10 and there is no alert set alert and send message
    3. If the percentage is greater than 80 clear alert
  3. Get and store page counts
  4. Get and store status message
  5. Perhaps read alert table?

All done except part 5.

Web part

Display list of printers. Expandable to show current supplies status. Automatically expand low supplies?
Add a new printer
Edit a printer

View usage/consumable history?


Counter candidates: (possibly add the option to get counter info from a URL with a regex?)

. (samsung bw: total pages)
. (samsung bw: total pages)

. (samsung colour: total pages)
. (samsung colour: mono pages)

. (hp2420: total pages)
. (hp2420: total pages)

. (colour lj3000: total pages)
. (clj: mono pages)
. (clj: colour pages)

. (kyo5100: total pages, disagrees with web and below)
. (kyo5100: total pages)
. (kyo5100: mono pages)
. (kyo5100: colour pages)

. (kyo5015: total pages)
. (kyo5015: mono pages)
. (kyo5015: colour pages)

. (hp CM2320fxi: total pages)
. (hp CM2320fxi: colour pages)
. (hp CM2320fxi: mono pages)