Query total page count via SNMP HP Laserjet

28,002

Solution 1

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:

2.43.10.2.1.4.1.1

Solution 2

The standard 'total page count' is at 1.3.6.1.2.1.43.10.2.1.4.1.1

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

Share:
28,002

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin almost 2 years

    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 10.168.5.1 HP-LASERJET-COMMON-MIB:.1.3.6.1.2.1.1.16.1.1.1
    

    (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  
    JET-COMMON-MIB..txt  
    .1.3.6.1.2.1.1.16.1.1.1  )  
    
    
    Unlinked OID in HP-LASERJET-COMMON-MIB: hp ::= { enterprises 11 }  
    Undefined identifier: enterprises near line 3 of C:/usr/share/snmp/mibs/HP-LASER  
    JET-COMMON-MIB..txt  
    HP-LASERJET-COMMON-MIB:.1.3.6.1.2.1.1.16.1.1.1:  
    

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

  • Admin
    Admin about 14 years
    Thanks for this. On our printers that OID is the correct page count and thanks for the pointer to the snmpwalk command.
  • Admin
    Admin about 14 years
    +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.
  • MUY Belgium
    MUY Belgium over 3 years
    I think this is not a good idea : paring html is always dificult...