[rrd-users] Re: Monitoring System Load (graphing it)
Graeme Donaldson
graeme at toxicbunny.net
Fri Dec 5 12:23:54 MET 2003
David Jenkins said:
> Hi,
>
> I've been using MRTG for a while and now have decided to have a play
> around with rrdtool.
>
> I have currently set it up (correctly I believe) to monitor the volume
> of network interface traffic on my server and am now trying to work out
> how to monitor the load on the server.
>
> I have searched the web and found many graphs displaying this data but
> have yet to come across the commands used to create the .rrd file and
> make/update the graph.
>
> I have checked the mailing list here as well and found a useful thread
> but it wasn't quite what I was looking for.
> I have also read "man rrdtutorial" a couple of times but I do obviously
> not understand something fundamental.
>
> I would be most grateful if someone could give me some help/pointers as
> to where I'm going wrong.
This is how I do it. I don't store the 1-min avg since I only do the
update every 5 minutes and it wouldn't really make much sense to do so.
Also, I'm not (currently) using SNMP to get the value, but it should be
fairly easy to modify to use SNMP.
*Create*
rrdtool create /var/db/rrd/loadavg.rrd \
DS:5min:GAUGE:600:U:U \
DS:15min:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:6:672 \
RRA:AVERAGE:0.5:24:744 \
RRA:AVERAGE:0.5:288:732 \
RRA:MAX:0.5:1:576 \
RRA:MAX:0.5:6:672 \
RRA:MAX:0.5:24:744 \
RRA:MAX:0.5:288:732
*Update*
#!/usr/local/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
echo $(uptime | sed -e 's/^.*load average.*: //' -e 's/ //g' | \
awk -F, "{ printf(\"update /var/db/rrd/loadavg.rrd N:%f:%f\", \$2, \$3)}")
| rrdtool -
*Graph*
#!/usr/local/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
tstamp=`date`
rrdtool graph /var/www/localhost/stats/loadavg-day.png \
--start now-1day \
--vertical-label "Load averages" \
--title "Load averages for the past day" \
--width 600 \
--height 200 \
--alt-autoscale-max \
--lower-limit 0 \
DEF:5minavg=/var/db/rrd/loadavg.rrd:5min:AVERAGE \
AREA:5minavg#0000dd:"5-min load avgs" \
GPRINT:5minavg:AVERAGE:"Avg\:%3.2lf" \
GPRINT:5minavg:MAX:"Max\:%3.2lf\n" \
COMMENT:"$tstamp\r"
HTH
Graeme
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list