HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Number of pages printed in HPUX
Operating System - HP-UX
1832567
Members
5110
Online
110043
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2003 06:43 AM
06-16-2003 06:43 AM
Hello,
I have an HPUX 11.00, with some remote and net printers. I want to make a report with:
- Number of pages printed by printer
- bytes transmitted
- jobs printed
Does anybody knows how to do this??
regards
I have an HPUX 11.00, with some remote and net printers. I want to make a report with:
- Number of pages printed by printer
- bytes transmitted
- jobs printed
Does anybody knows how to do this??
regards
"When you look into an abyss, the abyss also looks into you"
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2003 06:59 AM
06-16-2003 06:59 AM
Solution
One method would be to add a function to each interface file in /var/spool/lp/interface/printername.
The args supplied to each interface are
$1 - printer name
$2 - request id
$3 - user
$4 - title
$5 - number of copies
$6 - options
file1 file2 ....
you could use wc on each file to count bytes BUT this fails if stdin is used because you are now reading from a pipe. You would have to detect if the file is not a regular file and then use the tee command to feed wc and the rest of the normal lp stuff.
NOTE: UNIX has absolutely no concept of pages; you would have to either count lines or detect FF's (if they occur before your pagelength is reached).
Now the really bad news - all of this utterly fails if thrown binary/raw data; the bottom line: there is no way to do this without making some very limiting assumptions.
The args supplied to each interface are
$1 - printer name
$2 - request id
$3 - user
$4 - title
$5 - number of copies
$6 - options
file1 file2 ....
you could use wc on each file to count bytes BUT this fails if stdin is used because you are now reading from a pipe. You would have to detect if the file is not a regular file and then use the tee command to feed wc and the rest of the normal lp stuff.
NOTE: UNIX has absolutely no concept of pages; you would have to either count lines or detect FF's (if they occur before your pagelength is reached).
Now the really bad news - all of this utterly fails if thrown binary/raw data; the bottom line: there is no way to do this without making some very limiting assumptions.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2003 07:44 AM
06-16-2003 07:44 AM
Re: Number of pages printed in HPUX
For page counts, it would be best to get it directly from the printer. For LaserJets, You could grap this using lynx to pull it from the printer's web interface.
# of jobs transmitted can be determined from the log files /var/adm/lp/log and /var/adm/lp/ld.log (if enabled).
For bytes transferred, you would need to modify your printer scripts to record the file size in the log files.
# of jobs transmitted can be determined from the log files /var/adm/lp/log and /var/adm/lp/ld.log (if enabled).
For bytes transferred, you would need to modify your printer scripts to record the file size in the log files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2003 05:18 PM
06-16-2003 05:18 PM
Re: Number of pages printed in HPUX
As mentioned, the concept of pages is totally meaningless with today's printers. Back in the good old days of line printers with green bar paper, all that was printed was plain ASCII (or EBCDIC) text. This you could look through the text and predict the number of pages by counting lines. However, today's laser and inkjet printers don't print 6 or 8 lpi, 66 or 88 lines per page. Instead, application programs send pictures, fonts of varying sizes and non-printing data like macros.
So the printer is the only choice for the page count. And the byte count is not meaningful at all. There might be 10Kbytes of fonts loaded into the printer as part of the job but only a few characters on one page will be printed.
Note that a remote printer will be impossible to monitor from a client (ie, HP-UX sending a print job to an NT server) and only the very newest printers HP JetDirect cards have a web interface. Many deskjet printers do not return page information and older LaserJet printers cannot return any stats at all.
I'm sure that this is a request by management to monitor costs and perhaps send a bill at the end of the month. The effort to provide an accurate bill for each printer sorted by user will be enormous, thus eliminating any savings that such bills might produce. This is really a social engineering problem where user education and peer pressure is a lot more effective.
The alternative is to create a single print server with commercial billing software but now all jobs must go through the billing server--which means this server cannot go down!
Bill Hassell, sysadmin
So the printer is the only choice for the page count. And the byte count is not meaningful at all. There might be 10Kbytes of fonts loaded into the printer as part of the job but only a few characters on one page will be printed.
Note that a remote printer will be impossible to monitor from a client (ie, HP-UX sending a print job to an NT server) and only the very newest printers HP JetDirect cards have a web interface. Many deskjet printers do not return page information and older LaserJet printers cannot return any stats at all.
I'm sure that this is a request by management to monitor costs and perhaps send a bill at the end of the month. The effort to provide an accurate bill for each printer sorted by user will be enormous, thus eliminating any savings that such bills might produce. This is really a social engineering problem where user education and peer pressure is a lot more effective.
The alternative is to create a single print server with commercial billing software but now all jobs must go through the billing server--which means this server cannot go down!
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP