Skip to content

Char0n-1/snmp_printer_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¨ SNMP Printer Toner Checker

A Python-based async SNMP utility to check printer toner levels (remaining and maximum capacity), supporting multiple printers and tabular output.

πŸ“¦ Features

  • Async SNMP querying using pysnmp v7.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

πŸ“ Project Structure

printer-checker/
β”œβ”€β”€ printers.csv          # List of printer IPs and optional comments
β”œβ”€β”€ check_toner.py        # Main script
β”œβ”€β”€ requirements.txt      # Python dependencies
└── README.md             # Project documentation

πŸ”§ Requirements

  • Python 3.8+
  • pysnmp >= 7.1.0 (LexStudio)
  • tabulate

🧺 Setup & Usage

1. Clone the repository

git clone https://github.com/yourusername/printer-checker.git
cd printer-checker

2. Create and activate virtual environment

python3 -m venv snmp-env
source snmp-env/bin/activate  # On Windows: snmp-env\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Prepare printers.csv

ip,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

5. Run the script

python check_toner.py

🧾 Sample Output

+------------------+----------------+-------------+-----------+---------------+-----------+
| 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%      |
+------------------+----------------+-------------+-----------+---------------+-----------+

πŸ› οΈ Customization

  • 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.

πŸ“œ License

MIT License. See LICENSE for details.

About

A Python-based async SNMP utility to check printer toner levels

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages