Short answer Read the supply description, maximum capacity and current level tables from Printer-MIB using the same index. For valid values, toner percentage is current level / maximum capacity × 100.
Prepare the printer
- Enable SNMP only on the management network; never expose it to the internet.
- Prefer SNMPv3. If SNMPv2c is required, use a unique read-only community instead of public.
- Verify UDP/161 reachability from the management device to the printer.
Read the Printer-MIB tables
# Linux / net-snmp kurulu bir yönetim cihazı
snmpwalk -v2c -c <COMMUNITY> <YAZICI_IP> 1.3.6.1.2.1.43.11.1.1.6.1
snmpwalk -v2c -c <COMMUNITY> <YAZICI_IP> 1.3.6.1.2.1.43.11.1.1.8.1
snmpwalk -v2c -c <COMMUNITY> <YAZICI_IP> 1.3.6.1.2.1.43.11.1.1.9.1...43.11.1.1.6.1Supply descriptionReturns names such as black toner, cyan toner or drum.
...43.11.1.1.8.1Maximum capacityThe full capacity reported by the device.
...43.11.1.1.9.1Current levelThe remaining amount currently reported.
Match identical indexes
The index at the end of each OID identifies the same supply. For example, description .1.1, maximum capacity .1.1 and current level .1.1 belong together. Never calculate across different indexes.
If values are negative or invalid
Printer-MIB values such as -1, -2 and -3 can mean other, unknown or unavailable. Do not calculate a percentage for them; show “Unavailable”. Some vendors require proprietary OIDs, so validate each model.
Convert the returned value safely
Calculate only when maximum capacity is above zero and current level is not negative. Never convert special negative SNMP values into percentages.
# Convert sample SNMP values to a percentage
$Maximum = 10000
$Current = 2500
if ($Maximum -gt 0 -and $Current -ge 0) {
"Toner level: %{0}" -f [math]::Round(($Current/$Maximum)*100,1)
} else {
"Toner level unavailable"
}