[rrd-users] How to have a proper graph

Black bfvww2 at hotmail.com
Wed Mar 11 17:25:44 CET 2009


Hello!
I have an esthetic question for my graphs. I take the number of users on a shoutcast server every 5 minutes. I obtain this kind of graph:http://ozone-serveur.com/graphs/9608-test-day.png

As you can see, it creates some little "stairs" and not a linear graph such as http://oss.oetiker.ch/rrdtool/gallery/btdmd8.png
There are my files:#!/bin/bash
RRDTOOL="/usr/bin/rrdtool"
START=$(date +%s)
RRDB="/home/servid/9608/graph/rivendell.rrd"
STEP=300
$RRDTOOL create $RRDB --start $START --step $STEP \
        DS:rivendell:GAUGE:600:0:50 \
        RRA:AVERAGE:0.5:1:288 \
        RRA:AVERAGE:0.5:4:504 \
        RRA:AVERAGE:0.5:12:744 \
        RRA:MAX:0.5:1:288 \
        RRA:MAX:0.5:4:504 \
        RRA:MAX:0.5:12:744 \

#!/bin/bash

MY_IP="XXX.XXX.XXX.XXX"
MY_PORT="9608"

NB=$(SCRIPT_GET_NB.SH)

RRDTOOL=/usr/bin/rrdtool

RRD="/home/servid/9608/graph/rivendell.rrd"

echo "$RRDTOOL update $RRD N:${NB}"
$RRDTOOL update $RRD N:${NB}

GRAPH="/home/www/graphs/${MY_PORT}"
RRDB="/home/servid/9608/graph/rivendell.rrd"

START=$(date --date="-24 hours" +%s)
END=$(date +%s)

GRAPHTITLE="Fréquentation Serveur Streaming s1.gryware.com:${MY_PORT}"

for i in -86400 -604800 -2678400
  do
  if [ $i == -86400 ]
      then
      GRAPH2="${GRAPH}-test-day.png"
  fi
  if [ $i == -604800 ]
      then
      GRAPH2="${GRAPH}-test-week.png"
  fi
  if [ $i == -2678400 ]
      then
      GRAPH2="${GRAPH}-test-month.png"
  fi

$RRDTOOL graph "${GRAPH2}"                             \
      --start ${i}                                               \
      --end $END                                                 \
      --vertical-label "Auditeurs Connectés"                            \
      --title "${GRAPHTITLE}" -w 500            \
      --units-exponent 0 --imgformat PNG                         \
      --upper-limit=12    \
      --lower-limit=0 \
      --color CANVAS#FFFFFF                                      \
      --color BACK#F0F0F0                                        \
      --color FONT#000000                                        \
      --color MGRID#cccccc                                       \
      --color GRID#6699CC                                        \
      --color FRAME#000000                                       \
      --color ARROW#000000                                       \
      --color SHADEA#A0A0A0                                      \
      --color SHADEB#A0A0A0                                     \
      DEF:rivendell=${RRD}:rivendell:AVERAGE                        \
      CDEF:dessous=rivendell,100,*,100,/                              \
      CDEF:Ln1=rivendell,rivendell,UNKN,IF                              \
      VDEF:avg=rivendell,AVERAGE                        \
      COMMENT:"\n" \
      COMMENT:"Fréquentation Stream    "                          \
      COMMENT:"Maximum     Minimum    Moyenne      Dernier\n" \
      AREA:dessous#ECD748:"Auditeurs Connectés     "                \
      LINE1:Ln1#C9B215 \
      GPRINT:rivendell:MAX:"%2.0lf        "                             \
      GPRINT:rivendell:MIN:"%2.0lf       "                             \
      GPRINT:rivendell:AVERAGE:"%2.0lf        "                         \
      GPRINT:rivendell:LAST:"%2.0lf          " \
      COMMENT:"\n"  \
      HRULE:avg#EC9D48:"Moyenne"
done


How do you think i can create an homogeneous, beautiful and great graph?
Thanks for you help!
Pierre.S
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le maintenant ! 
http://www.windowslive.fr/messenger/1.asp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20090311/d648bb2f/attachment-0001.html 


More information about the rrd-users mailing list