PerlingTheUK has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
in order to calculate the cost of our printers, I would like to have a logfile, that logs the printers shared on my computer and at least retrieves information on the number of pages or any more in depth details (color/non-color) printout would be useful.
I am using ASPerl 5.8.4 and look for compatible modules if possible.

Cheers,
PerlingTheUK

Replies are listed 'Best First'.
Re: Windows Printer Log
by tachyon (Chancellor) on Sep 09, 2004 at 08:02 UTC
Re: Windows Printer Log
by BrowserUk (Patriarch) on Sep 09, 2004 at 08:51 UTC

    The following Performance metrics are available via Win32::PerfLib, which should go some way to getting you what you need.

    1450: Print Queue Displays performance statistics about a Print Queue. 1452: Total Jobs Printed Total number of jobs printed on a print queue since the last resta +rt. 1454: Bytes Printed/sec Number of bytes per second printed on a print queue. 1456: Total Pages Printed Total number of pages printed through GDI on a print queue since t +he last restart. 1458: Jobs Current number of jobs in a print queue. 1460: References Current number of references (open handles) to this printer. 1462: Max References Peak number of references (open handles) to this printer. 1464: Jobs Spooling Current number of spooling jobs in a print queue. 1466: Max Jobs Spooling Maximum number of spooling jobs in a print queue since last restar +t. 1468: Out of Paper Errors Total number of out of paper errors in a print queue since the las +t restart. 1470: Not Ready Errors Total number of printer not ready errors in a print queue since th +e last restart. 1472: Job Errors Total number of job errors in a print queue since last restart. 1474: Enumerate Network Printer Calls Total number of calls from browse clients to this print server to +request network browse lists since last restart. 1476: Add Network Printer Calls Total number of calls from other print servers to add shared netwo +rk printers to this server since last restart.

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon