[mrtg] Simple graphing tool

Jan Ferré Jan.Ferre at uni-c.dk
Thu Sep 30 10:10:12 CEST 2010


Arvon Griffiths wrote:
> I see that MRTG no longer generates the graphs and that you need another app to read from RRD and make the graphs.
>  
> I see Steve's Router2 script but it looks a little too much.
>  
> Can anyone suggest a script that can generate only the graphs as simple images and do it only when invoked?
>  
> We already have a web-page frame work and I fear too much change would spook some of my higher-ups.


We use the RRDCGI script:

#!/usr/bin/rrdcgi
<RRD::INCLUDE init.html>
<RRD::INCLUDE top.html>

<h1><RRD::CV::PATH INST> - <RRD::CV::PATH DATA></h1>
<div class="graph">
<h2>Two hour graph (5 minute average)</h2>
<RRD::GRAPH <RRD::CV::PATH DATA>-hour.png --title="Latest two hours"
        -w 700
        -s -2h
        DEF:InByte=../data/<RRD::CV::PATH INST>/<RRD::CV::PATH
DATA>:ds0:AVERAGE
        DEF:OutByte=../data/<RRD::CV::PATH INST>/<RRD::CV::PATH
DATA>:ds1:AVERAGE
        CDEF:In=InByte,8,"*"
        CDEF:Out=OutByte,8,"*"
        VDEF:InM=In,MAXIMUM
        VDEF:OutM=Out,MAXIMUM
        VDEF:InA=In,AVERAGE
        VDEF:OutA=Out,AVERAGE
        LINE1:In#0000ff:In
        LINE2:Out#00ff00:Out
        GPRINT:InM:"Max In - %0.1lf %sbit/s"
        GPRINT:OutM:"Max Out- %0.1lf %sbit/s"
        GPRINT:InA:"Avg In - %0.1lf %sbit/s"
        GPRINT:OutA:"Avg Out- %0.1lf %sbit/s"
>
</div>


Actually this file continues with more views of the same data (day,
week, month, year, biyear) - still only invoked when someone wants to
see the data. Then a seperate page to view packets, errors and discards.

rrdcgi is part of rrdtools

Jan

-- 
Jan Ferré - UNI-C Netdrift - DTU Bygning 304, DK-2800 Lyngby
tlf. +45 3587 8935, cell. +45 2160 8012, fax. +45 3587 8990
EAN-no.: 5798000555198



More information about the mrtg mailing list