1

I'm just getting started with HP Web Jetadmin 10.2 and I've set up e-mail notifications for errors. I'd also like to set up a monthly e-mail notification of the current page count, so that I can calculate the number of pages printed during the previous month and see if that number is increasing or decreasing. However, there doesn't appear to be a way to configure any sort of schedule. Am I missing something, or am I asking too much of this free utility?

EDIT: Thanks to RobW for pointing me towards a solution. I'm going to try and describe it here so that others can benefit. My solution uses snmptools and blat (links in the accepted answer).

I wrote a script called pagecount.bat which looks like this:


@ECHO OFF

@FOR /F "tokens=*" %%i IN ('C:\SNMPTools\snmptools.exe /v /query /h:192.168.1.12 /o:1.3.6.1.2.1.1.6.0') DO set deviceName=%%i
@FOR /F "tokens=*" %%i IN ('C:\SNMPTools\snmptools.exe /v /query /h:192.168.1.12 /o:1.3.6.1.2.1.43.10.2.1.4.1.1') DO set pageCount=%%i
ECHO %deviceName% %pageCount% > C:\SNMPTools\results.txt

@FOR /F "tokens=*" %%i IN ('C:\SNMPTools\snmptools.exe /v /query /h:192.168.1.13 /o:1.3.6.1.2.1.1.6.0') DO set deviceName=%%i
@FOR /F "tokens=*" %%i IN ('C:\SNMPTools\snmptools.exe /v /query /h:192.168.1.13 /o:1.3.6.1.2.1.43.10.2.1.4.1.1') DO set pageCount=%%i
ECHO %deviceName% %pageCount% >> C:\SNMPTools\results.txt

The first block uses the > operator to overwrite the file results.txt and subsequent blocks use the >> operator to append to the file. At the bottom of the file I have the following line:

C:\blat276\full\blat.exe C:\SNMPTools\results.txt -to somebody@example.com -subject "Printer page counts"

And the results are sent to the specified e-mail address.

Prior to running this script, I have configured blat on the server using the command

blat -install mail.example.com sender@example.com
This configuration only needs to be done once so it's not part of the script.

After some testing and being satisfied with the results, I set up a scheduled task to run the script at 12:05 AM on the first day of every month. Once I have two months-worth of data, the numbers can be subtracted from each other to determine the total pages printed during the month for each device. These results can then be multiplied by their respective cost per page and summed to get the total printing costs for the month.

We have a maintenance agreement on our photocopiers, so the cost per page is listed on the quarterly invoice. For our regular printers, the cost per page can be calculated by dividing the cost of a toner cartridge by the specified yield of that cartridge.

After you have your first set of monthly printing costs, the challenge is to try to reduce the costs next month. One possibility is to switch the locations of some printers so that the cheaper to operate printers are in the higher volume areas.

BTW: All this math is being done in an Excel spreadsheet.

Scott
  • 1,173
  • 3
  • 13
  • 25

2 Answers2

1

I dont think Web Jetadmin can do this.

I solved this problem with SNMP and Blat.

Your HP Printer offers SNMP counters of many types of printer statistics. Usings tools like snmpwalk.exe and getif.exe, and snmptools.exe you can get to these counters. Blat.exe can mail this report to you. Schedule a task to do it monthly.

SNMP stores data in structures called an OID. Each step in the OID represents a different branch. The page count OID for most printers is: 1.3.6.1.2.1.43.10.2.1.4.1.1. Each step stands for:

.iso.org.dod.internet.mgmt.mib-2.printmib.prtMarker.prtMarkerTable.prtMarkerEntry.prtMarkerLifeCount

If you know your OID, command line tools like snmptools.exe can extract the data:

c:\> snmptools.exe /v /query /h:10.0.0.4 /o:1.3.6.1.2.1.43.10.2.1.4.1.1
25892    

On my HP Lasterjet, the printed page count is 25892.

RobW
  • 2,766
  • 1
  • 17
  • 22
  • Thanks very much for pointing me in the right direction. I've added details regarding my finished solution. – Scott Nov 17 '11 at 18:33
0

Powershell gave me page counts for multiple network printers with a few minutes of work. Open a Powershell with administrative privileges, then add a SNMP commandlet from Microsoft's PowerShell Gallery like this:

PS C:\windows\system32> 
Register-PSRepository -Name PSGalleryPreview -SourceLocation https://www.Preview.PowerShellGallery.Com/api/v2
Install-Module -Name Proxx.SNMP -Repository PSGalleryPreview -Verbose
Invoke-SnmpGet -IpAddress 192.168.222.51 -Oid 1.3.6.1.2.1.43.10.2.1.4.1.1

REMARKS
    To see the examples, type: "get-help Invoke-SnmpGet -examples".
    For more information, type: "get-help Invoke-SnmpGet -detailed".
    For technical information, type: "get-help Invoke-SnmpGet -full". 

You can easily make lists of IP addresses for multiple printers and OID numbers for variables of interest, then print a summary to the console. Here is some quick code that works for an old B&W HP laserjet and two color Xerox network printers:

$printers = 'BULLWINKLE', 'ASTRO', 'ELROY'
$ips = '192.168.222.51', '192.168.222.54', '192.168.222.55'
$names = 'Black Page Count', 'Color Page Count', 'Total Page Count'
$oids = '1.3.6.1.4.1.253.8.53.13.2.1.6.1.20.34', '1.3.6.1.4.1.253.8.53.13.2.1.6.1.20.33', '1.3.6.1.2.1.43.10.2.1.4.1.1'
$counts = Invoke-SnmpGet -IpAddress $ips -Oid $oids

write-host "Printer Page Counts for" (Date)
$i = 0
foreach ($p in $printers){
    $j = 0
    While ($j -lt 3) {
        write-host $p $names[$j] $counts.value[$i]
        $i++
        $j++
    }     
}

Console:

Printer Page Counts for 8/28/2018 5:55:26 PM
BULLWINKLE Black Page Count Null
BULLWINKLE Color Page Count Null
BULLWINKLE Total Page Count 406024
ASTRO Black Page Count 7821
ASTRO Color Page Count 31614
ASTRO Total Page Count 39435
ELROY Black Page Count 56
ELROY Color Page Count 736
ELROY Total Page Count 792
user2511
  • 101