LPRng: Page Counting

2001-11-22 Thread Christopher Lee

Hi,

I'm attempting to do printer accounting with LPRng+ifhp. The printers in use
are all HP4000 series (be it 4000, 4050 or 4100). The Page Description
Language we are using is PCL (5 i think).

Currently, our print jobs from NT workstations are sent via samba to our
unix server. From here the job is then forwarded onto a smaller linux box
that is attached to the printer's parallel port. The smaller boxes run
ZipSlack (7.1, 2.2.16 Linux kernel) and LPRng (3.8.1) and ifhp (3.4.7).
We've had to go this route since not all our HP4000's have JetDirect cards
installed, some currently use NetGear PS110 print servers, which I'm told
can't do bi-directional communications, although I haven't tested it for
myself, and really don't have the time.

Anyway, I've got things setup relatively smoothly so far, and printing from
an NT workstation through to the HP is working. However the *big* problem
I'm having is getting a page count back from the printer.

I've toyed with the printcap entry for LPRng to no end, and still can't get
a page count back. If anyone out there has a working
printcap/ifhp.conf/anything else I need, could you please, please please
send me a copy/snippet of the relevant code?

I'm to the stage where I really need to get things working before this
project gets scrapped. I've read (and printed) the ifhp-howto, and read
through bits of the LPRng-howto, but I've found the parts on accounting to
be a bit thin, I think I really need dumbed down step-by-step instructions
on how to get it working, and working examples would be a good place to
start.

At present most of my printcap has been pieced together from bits and pieces
I've read between the two howto's. I just came across a section of interest
in the ifhp-howto, section 4.9 - PS,PCL,PJL Printer with Parallel Port
Connection.  From what I can tell I should probably have :rw defined in my
printcap to get the parallel port opened read-write. I had assumed this
would have happened by default, but perhaps it could be why I'm not getting
a pagecount?

We had a mild success today in getting a pagecount to work, basically we
followed through the ifhp readme to test it's working, and dumped the one.ps
file through ifhp out to a file. We then cut just the top part of the PJL
commands out, and inserted our own line, @PJL INFO PAGECOUNT, which I
found looking through the ifhp.c source, then echoed the file out to
/dev/lp0, and cat'd back /dev/lp0 and we got the magic page count number
back.

Yet I'm still unable to get LPRng+ifhp to get me this figure, and can't
figure out what I'm doing wrong, so I'll post our most recent printcap we've
been using and see if someone can point me in the right direction.

The ifhp.conf file is (to the best of my knowledge) the one that came with
ifhp, I don't think I modified it, as I'm sure it had more or less
everything correct. The accounting.pl is the one that shipped with LPRng (or
was it ifhp?), and I simply copied it to the /usr/local/libexec/filters
directory since the examples had it that way.

# B10 JetDirect HP Printer
#
b10-lp
:sh
:ml=0
:mx=0
:lp=/dev/lp0
:sd=/var/spool/lpd
:af=acct
:ps=status
:as=|/usr/local/libexec/filters/accounting.pl start
:ae=|/usr/local/libexec/filters/accounting.pl end
:filter=/usr/local/libexec/filters/ifhp
:of=/usr/local/libexec/filters/ifhp
:ifhp=model=hp4000,of_options=status pagecount waitend

#:ifhp=model=default
#:of=/usr/local/libexec/filters/ifhp
#:ifhp=model=hp6p,of_options=sync pagecount waitend

Any help with this would be greatly appreciated :-)

PS: Does anyone know where to find a PJL Technical Reference from HP? We
have the PCL 5e technical reference in PDF from HP, but even though the
cover says PCL/PJL it barely mentions PJL, and pagecount and page count
certainly don't exist anywhere in the document.

Regards,
Chris Lee



-
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:   | example:
subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-



Re: LPRng: Page Counting

2001-11-22 Thread Barry Wright

On Thu, 22 Nov 2001, Christopher Lee wrote:
 I'm attempting to do printer accounting with LPRng+ifhp. The printers in use
 are all HP4000 series (be it 4000, 4050 or 4100). The Page Description
 Language we are using is PCL (5 i think).
 
 Anyway, I've got things setup relatively smoothly so far, and printing from
 an NT workstation through to the HP is working. However the *big* problem
 I'm having is getting a page count back from the printer.

We have just got the following 2 printers to pagecount, our setup is
slightly different in that we are using printers with ethernet cards. The
key for us (patiently pointed out by Patrick Powell) was to include the lp
line and remove the rm line, he also recommended removing the lpd_bounce
line (works without it). We have used several different lpr's (3.7.4-23,
3.7.9, 3.8.1) with ifhp 3.4.7 and standard ifhp.conf lpd.conf lpd.perms 
accounting.pl files. The clients are typically RH7.1.

snip from /etc/printcap.local
p1:\
   :sh:\
   :ml=0:\
   :mx=0:\
   :sd=/var/spool/lpd/p1:\
   :lp=p1%9100:\
   :if=/usr/libexec/filters/ifhp:\
   :ifhp=model=hp4plus:\
   :as=|/usr/libexec/filters/accounting.pl start:\
   :ae=|/usr/libexec/filters/accounting.pl end:\
   :af=acct

p2:\
   :sh:\
   :ml=0:\
   :mx=0:\
   :sd=/var/spool/lpd/p2:\
   :if=/usr/libexec/filters/ifhp:\
   :lp=p2%9100:\
   :ifhp=model=hp4050:\
   :as=|/usr/libexec/filters/accounting.pl start:\
   :ae=|/usr/libexec/filters/accounting.pl end:\
   :af=acct

The following line proved that the printer could pagecount and confirmed
that the 9100 port was correct in our environment. 

/usr/libexec/filters/ifhp
-Tmodel=hp4050,dev=www.xxx.yyy.zzz%9100,trace,debug=0  test2.ps

HTH
Barry Wright


-
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:   | example:
subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-



Re: LPRng: Page Counting

2001-11-22 Thread christoph beyer

hi,

I think there was abug in IFHP, discovered last week, concerning 
accounting on the 4xxx series from HP:

  From [EMAIL PROTECTED] Fri Nov 16 13:11:30 2001
  Date: Fri, 16 Nov 2001 16:11:24 -0500 (EST)
  From: Jason Keltz [EMAIL PROTECTED]
  To: Patrick Powell [EMAIL PROTECTED]
  Subject:  HP 4100 page accounting
 
  Hi Patrick,
 
  I'm pretty sure I've found a bug in ifhp that was causing the problems
  with the HP 4100 print accounting.
 
  This morning, I wrote a little tcl script that talked to the 4100 
printer,
  setting the proper job USTATUS, sending a job, listening for the
  responses, and everything was as it should be.
 
  I then looked at the ifhp code with a coworker and we found the problem.
 
  In the function pjl_job(), in ifhp.c, there are these two lines:
 
  len = strlen(buffer);
  SNPRINTF(buffer+len, sizeof(buffer)-len) Job_display, Jobname );
 
  I believe they are both incorrect.
 
  First off, buffer has no value up to that point in the function, so why
  are you getting its length?
 
  Also, the SNPRINTF function ends up printing Job_display instead of
  Jobstart_str which is definately an error.  Here are the definitions of
  both of those:
 
   char *Job_display= DISPLAY = \%s\ ;
   char *Jobend_str=@PJL EOJ NAME = \%s\;
 
  ... and in fact, a previous ifhp version did have Jobend_str.  I checked.
 
  Why this was working on any of our other printers, I do not know.  More
  than likely the 4100 is smarter and doesn't like the bad syntax.  The
  Put_pjl was throwing away the error without commenting on it.
 
  The two lines should be replaced with just this one:
   SNPRINTF(buffer, sizeof(buffer)) Jobstart_str, Jobname );
 
  Works for me..
 
  Jas.
 


Christopher Lee wrote:

Hi,

I'm attempting to do printer accounting with LPRng+ifhp. The printers in use
are all HP4000 series (be it 4000, 4050 or 4100). The Page Description
Language we are using is PCL (5 i think).

Currently, our print jobs from NT workstations are sent via samba to our
unix server. From here the job is then forwarded onto a smaller linux box
that is attached to the printer's parallel port. The smaller boxes run
ZipSlack (7.1, 2.2.16 Linux kernel) and LPRng (3.8.1) and ifhp (3.4.7).
We've had to go this route since not all our HP4000's have JetDirect cards
installed, some currently use NetGear PS110 print servers, which I'm told
can't do bi-directional communications, although I haven't tested it for
myself, and really don't have the time.

Anyway, I've got things setup relatively smoothly so far, and printing from
an NT workstation through to the HP is working. However the *big* problem
I'm having is getting a page count back from the printer.

I've toyed with the printcap entry for LPRng to no end, and still can't get
a page count back. If anyone out there has a working
printcap/ifhp.conf/anything else I need, could you please, please please
send me a copy/snippet of the relevant code?

I'm to the stage where I really need to get things working before this
project gets scrapped. I've read (and printed) the ifhp-howto, and read
through bits of the LPRng-howto, but I've found the parts on accounting to
be a bit thin, I think I really need dumbed down step-by-step instructions
on how to get it working, and working examples would be a good place to
start.

At present most of my printcap has been pieced together from bits and pieces
I've read between the two howto's. I just came across a section of interest
in the ifhp-howto, section 4.9 - PS,PCL,PJL Printer with Parallel Port
Connection.  From what I can tell I should probably have :rw defined in my
printcap to get the parallel port opened read-write. I had assumed this
would have happened by default, but perhaps it could be why I'm not getting
a pagecount?

We had a mild success today in getting a pagecount to work, basically we
followed through the ifhp readme to test it's working, and dumped the one.ps
file through ifhp out to a file. We then cut just the top part of the PJL
commands out, and inserted our own line, @PJL INFO PAGECOUNT, which I
found looking through the ifhp.c source, then echoed the file out to
/dev/lp0, and cat'd back /dev/lp0 and we got the magic page count number
back.

Yet I'm still unable to get LPRng+ifhp to get me this figure, and can't
figure out what I'm doing wrong, so I'll post our most recent printcap we've
been using and see if someone can point me in the right direction.

The ifhp.conf file is (to the best of my knowledge) the one that came with
ifhp, I don't think I modified it, as I'm sure it had more or less
everything correct. The accounting.pl is the one that shipped with LPRng (or
was it ifhp?), and I simply copied it to the /usr/local/libexec/filters
directory since the examples had it that way.

# B10 JetDirect HP Printer
#
b10-lp
:sh
:ml=0
:mx=0
:lp=/dev/lp0
:sd=/var/spool/lpd
:af=acct
:ps=status

LPRng: page counting

2001-10-11 Thread Ron McKeating

Has anybody got a simple guide to page counting and how you turn it on,
I damned if we can make it work for a hp8100.  Any useful tips
appreciated.

Ron
-- 
Ron McKeating
Computing Officer
Computing Services
Loughborough University
http://www.ronmac.lboro.ac.uk/~ccrjm/
Tel:01509 222329
Fax:01509 223989


-
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:   | example:
subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-



Re: LPRng: page counting

2001-10-11 Thread Ryan Novosielski

What is the printcap you're currently trying? Perhaps you're shutting it
off and you don't realize it. I have an 8150 that works fine... two of
them, actually.

 _  _ _  _ ___  _  _  _
|Y#| |  | |\/| |  \ |\ |  |  | Ryan Novosielski - Jr. UNIX Systems Admin
|$| |__| |  | |__/ | \| _|  | [EMAIL PROTECTED] - 732/235.4473 (5-4473)
\__/ Univ. of Med. and Dent. | IST/ACS - Robert Wood Johnson MS - S-B11

On 11 Oct 2001, Ron McKeating wrote:

 Has anybody got a simple guide to page counting and how you turn it on,
 I damned if we can make it work for a hp8100.  Any useful tips
 appreciated.

 Ron
 --
 Ron McKeating
 Computing Officer
 Computing Services
 Loughborough University
 http://www.ronmac.lboro.ac.uk/~ccrjm/
 Tel:  01509 222329
 Fax:  01509 223989


 -
 YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
 The address you post from MUST be your subscription address

 If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
 or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
 to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
 with:   | example:
 subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
 unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

 If you have major problems,  send email to [EMAIL PROTECTED] with the word
 LPRNGLIST in the SUBJECT line.
 -



-
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:   | example:
subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-



Re: LPRng: page counting

2001-10-11 Thread andrew morgan

On 11 Oct 2001, Ron McKeating wrote:

 Has anybody got a simple guide to page counting and how you turn it on,
 I damned if we can make it work for a hp8100.  Any useful tips
 appreciated.

We are using page counting here on our hp8100 using LPRng v3.7.4 and ifhp
v3.4.4.  Here is the printcap entry for one of our hp8100s:

scfmain1|:
:lp=scfmain1.scf.orst.edu%9100:
:mx#0:rw:sh:
:ps=status
:af=acct
:lf=log
:sd=/var/spool/lpd/scfmain1
:fx=flpv
:ifhp=model=hp8100,tbcp
:if=/private/ifhp/libexec/filters/ifhp
:as=|/private/ifhp/libexec/filters/acct.pl start
:ae=|/private/ifhp/libexec/filters/acct.pl end
:ss=scfmain


This is using the default, unmodified ifhp.conf file.  I have made local
modifications to acct.pl to stick the page count in a database, send
emails, etc.

Andy


-
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:   | example:
subscribe LIST mailaddr   |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST mailaddr |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-