Print Server / Printer Accounting
Matthew Keller
kellermg at potsdam.edu
Fri Jul 21 12:27:46 GMT 2000
Adrian Head wrote:
>
> Quite some time ago I tried to get the internal page count out of a HP
> LaserJet 4MV with a DirectJet card. I tried a few things at the time
> including SNMP but could not find the page count. What did I miss at
> the time?? Where can I go to get more information - for memory HP web
> site and service support were not very helpful.
Make a TCP connection to port 9100 and send the PJL command @PJL INFO
PAGECOUNT. A Perl snippet is below.
my $sock=IO::Socket::INET->new(PeerAddr => "$ipaddress",
PeerPort => '9100',
Proto => 'tcp',
Type => SOCK_STREAM) || die "Sorry,
could no
t connect to $ipaddress, port 9100.\n!";
my $eol="\x0A"; # Hardcode the return character for portability
my $pagecount="\@PJL INFO PAGECOUNT$eol";
my $stuff;
$sock->send("$pagecount");
$sock->recv($stuff, 1024);
close $sock;
--
Matthew Keller
Lead Programmer/Analyst
Distributed Computing/Telemedia
Information Services Division
State University of New York at Potsdam
Website: http://mattwork.potsdam.edu/
PGP: http://mattwork.potsdam.edu/crypto/
Webcam: http://webcam.mattwork.potsdam.edu:85/
More information about the samba-ntdom
mailing list