A Python-based async SNMP utility to check printer toner levels (remaining and maximum capacity), supporting multiple printers and tabular output.
- Async SNMP querying using
pysnmpv7.1+ - Reads printer IPs and optional comments from a CSV file
- Displays toner info in a clean terminal table (
tabulate) - Skips disabled devices based on comment field
- Supports black toner or other consumables via index
printer-checker/
βββ printers.csv # List of printer IPs and optional comments
βββ check_toner.py # Main script
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Python 3.8+
pysnmp >= 7.1.0(LexStudio)tabulate
git clone https://github.com/yourusername/printer-checker.git
cd printer-checkerpython3 -m venv snmp-env
source snmp-env/bin/activate # On Windows: snmp-env\Scripts\activatepip install -r requirements.txtip,comment
192.168.1.97,
192.168.1.114,test lab
192.168.1.121,main office
192.168.1.122,disabled # will be skipped
python check_toner.py+------------------+----------------+-------------+-----------+---------------+-----------+
| IP Address | Description | Comment | Remaining | Max Capacity | Toner % |
+------------------+----------------+-------------+-----------+---------------+-----------+
| 192.168.1.97 | Black Toner | | 8727 | 10000 | 87% |
| 192.168.1.114 | Black Toner | test lab | -3 | -2 | Unknown |
| 192.168.1.121 | Drum Cartridge | main office | 5000 | 5000 | 100% |
+------------------+----------------+-------------+-----------+---------------+-----------+
- To check other consumables (e.g., Drum, Color toner), change the oid in the script.
- You can export to CSV or schedule the script as a cron job if needed.
MIT License. See LICENSE for details.