[sdnog] creating cacti graphs

Frank Habicht geier at geier.ne.tz
Tue Sep 12 08:40:07 SAST 2017


Hi Samir,

I have scripts (running every 5 minutes) that do similar graphs.

they start with :
   /usr/bin/rrdtool graph <filename> \

have definitions:
   DEF:sea_in="$rrd-file":traffic_in:AVERAGE \
   DEF:sea_out="$rrd-file":traffic_out:AVERAGE \
(might be counting bytes, not bits)

and CDEFs:
   CDEF:cdef_sea_in=sea_in,8,* \
   CDEF:cdef_sea_out=sea_out,-8,* \

and later:
   AREA:cdef_sea_in#FF20FFFF:"Seacom      In" \
   GPRINT:cdef_sea_in:LAST:" Current\:%8.2lf %s" \
   GPRINT:cdef_sea_in:AVERAGE:"Average\:%8.2lf %s" \
   GPRINT:cdef_sea_in:MAX:"Maximum\:%8.2lf %s\n" \
...
   AREA:cdef_sea_out#FF40FFFF:"Seacom      Out" \
   GPRINT:cdef_sea_out:LAST:"Current\:%8.2lf %s" \
   GPRINT:cdef_sea_out:AVERAGE:"Average\:%8.2lf %s" \
   GPRINT:cdef_sea_out:MIN:"Minimum\:%8.2lf %s\n" \


instead of Area you can choose LINE[123].

from your pic it seems they have an AREA from the value in the DEF
aggregated with "AVERAGE" and a LINE (darker colour) aggregated in the
DEF with "MAX" which should show same values on the daily graph, but in
eg the monthly you would see spikes in the MAX that are averaged out to
lower values in the AVERAGE.


If your main question is how to get things drawn below the x-axis, as
negative values; that's the '-' minus in the CEDF definition.


remember, the rrdtool command must be one line, that's why the '\'
immediately before the line break.

Greetings,
Frank



On 9/12/2017 8:22 AM, Samir Abdull
atif wrote:
> Hi all 
> 
> Does any one knows how to make cacti graphs as per attached image? 
> 
> Also how to stack multiple interfaces on the same type of graph? 
> 
> -- 
> Samir
> 
> 
> _______________________________________________
> sdnog mailing list
> sdnog at sdnog.sd
> http://lists.sdnog.sd/mailman/listinfo/sdnog
> 



More information about the sdnog mailing list