[mrtg] Graphing printer usage

Chris Goralski CGoralski at wcc.qld.edu.au
Tue Oct 25 03:39:22 CEST 2011


Hey Leos,

Thanks for the feedback.    I'll check it out.


Cheers,


Chris Goralski 
Systems Administrator

Westside Christian College
65 Stuart Street
GOODNA  QLD  4300
Ph: +61 7 3437 9032
Mo: +61 404 822 486
Email: cgoralski at wcc.qld.edu.au
Web: www.wcc.qld.edu.au


-----Original Message-----
From: j.halifax2 at seznam.cz [mailto:j.halifax2 at seznam.cz] 
Sent: Thursday, 20 October 2011 12:57 PM
To: Chris Goralski
Cc: mrtg at lists.oetiker.ch
Subject: Re: [mrtg] Graphing printer usage


Hi Chris,

If you wish that the great mrtg draws for you the results calculated in your script, you need to use the Option of "gauge". In your example below mrtg understands your script data output type as counter and draws the differences (simplified). Check the docs, it is described nice way there.

Regards,
Leos



> ------------ Původní zpráva ------------
> Od: Chris Goralski <CGoralski at wcc.qld.edu.au>
> Předmět: [mrtg] Graphing printer usage
> Datum: 20.10.2011 02:02:44
> ----------------------------------------
> Hi,
> 
> I've recently been working on a project which focuses on gathering 
> printer meter readings using snmp and placing this data into a mysql db.  This all works fine.
>  I do this every 5 minutes.
> 
> I've since installed MRTG and am wanting to graph the number of print 
> jobs during this 5 minute period.
> 
> I've created a PHP script which is set as the target in mrtg.cfg.   The printer
> name can be passed to the script as a command line option which makes it
> particularly good in this sense.   The script queries mysql and calculates the
> number of pages printed in the last 5 minutes.  This data is then 
> output in the
> form:
> 5
> 0
> 
> (Just the two lines)  The 5 represents say, 5 pages in total and the 0 
> represents 0 b/w pages.
> 
> I'll post my mrtg.cfg file below.
> 
> 
> # Global configuration
> WorkDir: /var/www/mrtg/printers
> MaxBytes[_]: 20000
> Options[_]: gauge,growright
> Refresh: 300
> Interval: 60
> Factor[_]: 1
> 
> # E0_ColLaser
> MaxBytes[E0_ColLaser]: 1500
> AbsMax[E0_ColLaser]: 3000
> Options[E0_ColLaser]: growright, nopercent, noinfo, withzeroes, 
> integer, perhour, unknaszero
> Step[E0_ColLaser]: 300
> Target[E0_ColLaser]: `php /var/www/mrtg/scripts/get_meters_from_db.php
> E0_ColLaser`
> Title[E0_ColLaser]: Meters - E0_ColLaser
> PageTop[E0_ColLaser]: <h1>Meters - E0_ColLaser</h1>
> YLegend[E0_ColLaser]: Jobs in the past 5 minutes
> ShortLegend[E0_ColLaser]: Pages / 5 Mins
> LegendI[E0_ColLaser]: Total Prints / 5 Mins
> LegendO[E0_ColLaser]: Colour Prints / 5 Mins
> 
> # E2_ColLaser
> MaxBytes[E2_ColLaser]: 1500
> AbsMax[E2_ColLaser]: 3000
> Options[E2_ColLaser]: growright, nopercent, noinfo, withzeroes, 
> integer, perhour, unknaszero
> Step[E2_ColLaser]: 300
> Target[E2_ColLaser]: `php /var/www/mrtg/scripts/get_meters_from_db.php
> E2_ColLaser`
> Title[E2_ColLaser]: Meters - E2_ColLaser
> PageTop[E2_ColLaser]: <h1>Meters - E2_ColLaser</h1>
> YLegend[E2_ColLaser]: Jobs in the past 5 minutes
> ShortLegend[E2_ColLaser]: Pages / 5 Mins
> LegendI[E2_ColLaser]: Total Prints / 5 Mins
> LegendO[E2_ColLaser]: Colour Prints / 5 Mins
> 
> 
> NB:  My printers print at 25 pages per minute.   I've used 25*60 to get a pages
> per hour figure and hopefully set the global interval at 60 minutes.
> 
> The figures I'm getting are completely wrong.  For example, I've 
> printed at the most 2 or 3 pages and yet my graph shows the following 
> values and the scale has a max value of 36?
> 
> Total Prints / 5 Mins
> 
> 35 Pages / 5 Mins
> 
> 0 Pages / 5 Mins
> 
> 0 Pages / 5 Mins
> 
> Colour Prints / 5 Mins
> 
> 11 Pages / 5 Mins
> 
> 0 Pages / 5 Mins
> 
> 0 Pages / 5 Mins
> 
> 
> 
> Please, any assistance in understanding:
> 
> 1)       What output I need to provide from my script so that MRTG can use it as
> input data
> 
> 2)      Configure MRTG to simply graph the integer value for pages printed per 5
> minute interval.
> 
> 
> 
> Cheers,
> Chris
> 
> 
> 



More information about the mrtg mailing list