Thursday, March 12, 2009

Tracking network printer usage with SNMP.

First I need a list of printer names or IP addresses. This is what I used but my printer descriptions all have the IP address listed.

net view \\printserver > printerlist.txt

          (sample printerlist.txt)
          printerA Print IP: 192.168.3.1
          printerB Print IP: 192.168.3.5

I installed Net-SNMP and created checkusage.bat.

for /F "tokens=4" %%a in (printerlist.txt) do (
echo %%a
snmpget -v 1 -c public %%a 1.3.6.1.2.1.43.10.2.1.4.1.1
)


This will give output like.

192.168.3.1SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 = Counter32: 288975192.168.3.5SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 = Counter32: 19710

I tried this with various HP, Minolta, Savin, Ricoh and Canon printers. Now I can run this monthly and import into a spreadsheet.

What I really need are the counters for color and B/W. I can not find those with SNMP.

No comments: