Suppiluliuma wrote:

> On 22 Mar 2000 [EMAIL PROTECTED] wrote:
>
> > Suppiluliuma <[EMAIL PROTECTED]> writes:
> >
> > > Hello!
> >
> > Hello,
> >
> > > I'm looking for solution to my problem. The problem is that I want
> > > to know who uses printer and how much paper/ink my users waste. I've
> > > learned that adding line:
> > >     :af=/var/log/printeracc:
> > > to /etc/printcap is not enough. This line only describes parameter
> > > passed to print filter to be used as accounting file. However standard
> > > filter that comes with distribution does not know about
> > > accounting. Therefore I have a couple of questions:
> > > 0. Am I doing something wrong?
> > > 1. Where can I find printing filter that does accounting?
> > > 2. If above is not possible then where can I find info on accounting
> > > data format that filter should write to accounting file? (so I can use
> > > standard tools like pac)
> > > 3. Is there any other solution to the problem?
> > >
> > > Thanks in advance
> >
> > This seems to be necessary to hack directly into "if" as it seems not to check
> > for parameters provided by lpd. check with "man printcap".
> >
> > "if" is copied from /var/lib/rhs/rhs-printfilters/master-filter on each
>
> it is /usr not /var
>
> > spool directory. by default when using SMB, NCP or DIRECT printing, this filter
> > assume a hard accouting file of acct in the spool directory
> > (/var/spool/lpd/<lp>/).
>
> Looking in master-filter I've only found this:
>
> if [ "$PRINTER_TYPE" = "SMB" ]; then
>         bestpath="$bestpath | ${FPIDIR}/smbprint ${SPOOLDIR}/acct"
> elif [ "$PRINTER_TYPE" = "NCP" ]; then
>         bestpath="$bestpath | ${FPIDIR}/ncpprint ${SPOOLDIR}/acct"
> fi
>
> and no similiar entry for plain local printer. Samba is obvious, but I'm
> not sure about NCP (what does it state for?) Anyway, ncpprint uses
> nprint which is not installed on my system. I investigated further only
> to find out that accounting file name is used in SMB and NCP print filters
> to extract spool directory (!!!) name from it. No accounting information
> is written to accounting file (at least in smbprint filter).
> Since I can't find any info on format of accounting data i can't write
> my own hack to master-filter.
>
> Regards
>                         Suppiluliuma
>

Hmmm, the most logical place to make an accounting file is at the target machine
which actually sends data to the printer, or at the several targets, then tee the
pages to some logfile headed by or tailed by user info.  A grep on that file(for
formfeeds) along with a tail could count pages and identify the account--kinda ugly
but perhaps suitable especially if you email all the info to some central location.

I regret that I have not been in a situation where paper and ink were dear enough to
design such a scheme, or even to think that it might be worth my time to do so.
I bow to your superior knowledge of your own situation and wish you luck, though.

Just FWIW, you might find it easier to hack
http://www.freebsd.org/~andreas/#APSFILTER   It works under most linux distros quite
well, and its most recent version is March 20.

Civileme


Reply via email to