It's useful to know when a printer is running out of toner...
Usage
PRINTER_POLL(1) User Contributed Perl Documentation PRINTER_POLL(1)
NAME
printer_poll.pl - Get printer status and store it in a sqlite db
SYNOPSIS
printer_poll.pl [options]
Options:
-db
-initdb
-add <name> -ip <ip> -contact <email>[,email...] [-bw_count oid]
[-col_count oid] [-tot_count oid]
-list
-delete <id>
-dump
-chart <id> (disabled)
OPTIONS
-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
DESCRIPTION
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%
Development
Polling Part
For each printer
- Get and store consumable levels.
- For each consumable
- Convert to percentage
- If the percentage is less than 10 and there is no alert set alert and send message
- If the percentage is greater than 80 clear alert
- Get and store page counts
- Get and store status message
- Perhaps read alert table? 1.3.6.1.2.1.43.18.1
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?
Notes
Counter candidates: (possibly add the option to get counter info from a URL with a regex?)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (samsung bw: total pages)
.1.3.6.1.4.1.236.11.5.1.1.9.2.0 (samsung bw: total pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (samsung colour: total pages)
.1.3.6.1.4.1.236.11.5.1.1.9.2.0 (samsung colour: mono pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (hp2420: total pages)
.1.3.6.1.4.1.11.2.3.9.4.2.1.1.16.1.10.0 (hp2420: total pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (colour lj3000: total pages)
.1.3.6.1.4.1.11.2.3.9.4.2.1.1.16.4.1.1.2.0 (clj: mono pages)
.1.3.6.1.4.1.11.2.3.9.4.2.1.1.16.4.1.3.2.0 (clj: colour pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (kyo5100: total pages, disagrees with web and below)
.1.3.6.1.4.1.1347.42.2.1.1.1.6.1.1 (kyo5100: total pages)
.1.3.6.1.4.1.1347.42.2.1.1.1.7.1.1 (kyo5100: mono pages)
.1.3.6.1.4.1.1347.42.2.1.1.1.8.1.1 (kyo5100: colour pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (kyo5015: total pages)
.1.3.6.1.4.1.1347.42.2.2.1.1.3.1.1 (kyo5015: mono pages)
.1.3.6.1.4.1.1347.42.2.2.1.1.3.1.2 (kyo5015: colour pages)
.1.3.6.1.2.1.43.10.2.1.4.1.1 (hp CM2320fxi: total pages)
.1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.2.7.0 (hp CM2320fxi: colour pages)
.1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.2.6.0 (hp CM2320fxi: mono pages)