I was asked to get hold of the total pages counts for the 100+ printers we have at work. All of them are HP Laser or Business Jets of some description and the vast majority are connected via some form of HP JetDirect network card/switch. After many hours of typing in IP addresses and copying and pasting the relevant figure in to Excel I have now been asked to do this on a weekly basis. This led me to think there must be an easier way, as an IT professional I can surely work out some time saving method to solve this issue.

Suffice it to say I do not feel very professional now after a day or so of trying to make SNMP work for me!

From what I understand the first thing is to enable SNMP on the printer. Done. Next I would need something to query the SNMP bit. I decided to go open source and free and someone here recommended net-snmp as a decent tool (I would like to have just added the printers as nodes in SolarWinds but we are somewhat tight on licences apparently). Next I need the name of the MIB. For this I believe the HP-LASERJET-COMMON-MIB has the correct information in it. Downloaded this and added to net-snmp. Now I need the OID which I believe after much scouring is printed-media-simplex-count (we have no duplex printers, that we are interested in at least). Running the following command yields the following demoralising output:

snmpget -v 2c -c public HP-LASERJET-COMMON-MIB:.

(the OID was derived from running:

snmptranslate -IR -On printed-media-simplex-count  
Unlinked OID in HP-LASERJET-COMMON-MIB: hp ::= { enterprises 11 }  
Undefined identifier: enterprises near line 3 of C:/usr/share/snmp/mibs/HP-LASER  
.  )  

Unlinked OID in HP-LASERJET-COMMON-MIB: hp ::= { enterprises 11 }  
Undefined identifier: enterprises near line 3 of C:/usr/share/snmp/mibs/HP-LASER  

Am I barking up the wrong tree completely with this? My aim was to script it all to output to a file for all the IP addresses of the printers and then plonk that in Excel for my lords and masters to digest at their leisure. I have a feeling I am using either the wrong MIB or the wrong OID from said MIB (or both). Does anyone have any pointers on this for me? Or should I give up and go back to navigationg each printers web page individually (hoping not).

3 Answers 3


Well this is fairly odd-I thought that information was exposed via SNMP. However a quick snmpwalk of one of our P4515s revealed only the number of pages printed with the currently installed fuser. To look at all the info exposed via snmp I did the following:

snmpwalk -Cc -v 1 -c public ipaddress

If the OID for the printed pages on the currently installed fuser is any use it is:
  • Thanks for this. On our printers that OID is the correct page count and thanks for the pointer to the snmpwalk command.
    – user35213
    Jun 9, 2010 at 8:48

The standard 'total page count' is at

Different models use different OID for details, such as number of pages faxed/copied/printed/duplex/color/black/....


I can't help with the MIB I'm afraid but you could use PowerShell to take the grind out of grabbing the values from the web page on the printer. It should be possible to modify the example below to do what you need:


Perl/Python also have Web scraping modules if that's an option.

  • +1. I would have voted this up as well but dont have the rep as yet. Think this will be useful for countless other projects I have in the pipeline. Thanks for taking the time.
    – user35213
    Jun 9, 2010 at 8:49
  • 1
    I think this is not a good idea : paring html is always dificult... Oct 16, 2020 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy