[mrtg] Re: monitoring printers?

Ni Patrick-A11024 Patrick.Ni at motorola.com
Thu Feb 22 19:07:51 MET 2001


HI,

1.  This is the PrinterTraffic script.
#! /usr/bin/perl
##################################################################
# PrinterTraffic 1.0
##################################################################
# Created by Patrick Ni-a11024 in November 2000
#
# PrinterTraffic needs the hostnames of two LaserJet printers as 
# parameters. 
##################################################################


require 5.60;
use strict;
my $DEBUG = 0;
 

use FindBin;
use lib "${FindBin::Bin}";
use lib "${FindBin::Bin}${main::SL}..${main::SL}lib${main::SL}mrtg2";

use SNMP_util "0.77";
use Getopt::Long;
use Pod::Usage;
use Socket;


sub main {
    init();
    my $pcl_count = (snmpget('public'.'@'.$ARGV[0],'pcl-total-page-count'))[0];
    my $ps_count = (snmpget('public'.'@'.$ARGV[0],'postscript-total-page-count'))[0]; 
    my $page_count1 = $pcl_count + $ps_count;
    print "$page_count1\n";

    $pcl_count = (snmpget('public'.'@'.$ARGV[1],'pcl-total-page-count'))[0];
    $ps_count = (snmpget('public'.'@'.$ARGV[1],'postscript-total-page-count'))[0];
    my $page_count2 = $pcl_count + $ps_count;
    print "$page_count2\n";
 
}

main;
exit 0;


sub init () {
  snmpmapOID('pcl-total-page-count' =>  '1.3.6.1.4.1.11.2.3.9.4.2.1.3.3.3.5.0',
             'postscript-total-page-count' => '1.3.6.1.4.1.11.2.3.9.4.2.1.3.3.4.5.0');
}


2. This is the cfg file.
WorkDir: /local/apache-1.3.12/htdocs/mrtg/printers 
Options[_]: perminute 
Forks: 4
WriteExpires: Yes
Refresh: 300
Interval: 30
MaxBytes[_]: 1000
YLegend[_]: Pages per 30Mins  
ShortLegend[_]:  &nbsp
Legend1[_]: Page count per 1/2 hour for first printer 
Legend2[_]: Page count per 1/2 hour for second printer 
NoMib2: Yes
Unscaled[_]: dmwy

 

Target[printers_1]: `/local/mrtg/bin/PrinterTraffic gprslp p1nw3` *30
Title[printers_1]: Traffic Analysis for printers gprslp and p1nw3 
PageTop[printers_1]: <H1>Pages per 30Mins for gprslp and p1nw3</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>Printers gprslp and p1nw3</TD></TR>
   <TR><TD>Maintainer:</TD> <TD>Patrick Ni-a11024 at 241-6085</TD></TR>
 </TABLE>
===============

Hope this helps.

Patrick Ni
ITS UNIX System Administrator
Motorola Vancouver
11411, No. 5 Road, Richmond, BC Canada  V7A 4Z3

Tel: 604-241-6085 
Fax: 604-241-6042 
Cell: 604-719-2781
Email: Patrick.Ni at Motorola.com


-----Original Message-----
From: Kristjan Thordarsson [mailto:kth at hp.is]
Sent: Thursday, February 22, 2001 4:38 AM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] monitoring printers?


Does anyone know how to monitor page printed per minute on HP printers?

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list