File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / doc / scripts / rrdtool-graph.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 10:32:48 2013 UTC (11 years, 2 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_41p8, v1_4_35p0, v1_4_35, v1_4_33, HEAD
1.4.33

#!/bin/sh

RRDTOOL=/usr/bin/rrdtool
OUTDIR=/var/www/servers/www.example.org/pages/rrd/
INFILE=/var/www/lighttpd.rrd
OUTPRE=lighttpd-traffic

DISP="DEF:bin=$INFILE:InOctets:AVERAGE \
      DEF:binmin=$INFILE:InOctets:MIN \
      DEF:binmax=$INFILE:InOctets:MAX \
      DEF:bout=$INFILE:OutOctets:AVERAGE \
      DEF:boutmin=$INFILE:OutOctets:MIN \
      DEF:boutmax=$INFILE:OutOctets:MAX \
      LINE1:bin#0000FF:in \
      LINE1:binmin#2222FF: \
      STACK:binmax#2222FF: \
      LINE1:bout#FF0000:out \
      LINE1:boutmin#FF2222: \
      STACK:boutmax#FF2222: \
      -v bytes/s"

$RRDTOOL graph $OUTDIR/$OUTPRE-hour.png -a PNG --start -14400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-day.png -a PNG --start -86400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-month.png -a PNG --start -2592000 $DISP

OUTPRE=lighttpd-requests

DISP="DEF:req=$INFILE:Requests:AVERAGE \
      DEF:reqmin=$INFILE:Requests:MIN \
      DEF:reqmax=$INFILE:Requests:MAX \
      LINE1:req#0000FF:requests \
      LINE1:reqmin#2222FF: \
      STACK:reqmax#2222FF: \
      -v req/s"

$RRDTOOL graph $OUTDIR/$OUTPRE-hour.png -a PNG --start -14400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-day.png -a PNG --start -86400 $DISP
$RRDTOOL graph $OUTDIR/$OUTPRE-month.png -a PNG --start -2592000 $DISP

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>