Here is the instructions and such from the WayBack Machine.
my home network is built upon a wireless LAN using Orinoco RG-1000. however, the network performance from my linux server to Internet is poor due to the server location is separated from a ‘thick’ concrete wall. i need some tools to monitor the details such as signal strength, link rate… etc.
mrtg is the first things come to my mind. i search thru google.com and discovered Martin from Western Austrila has already do a great job using rrdtool.
mrtg has a long history in the Net and many people are using it around the world. mrtg does not only collect data every 5 mins, but also generate graph every 5 mins. the graph generation is cpu & io intensive and it limited the scability of mrtg. author of mrtg reimplement mrtg as rrdtool (round robin database) and it separated data acquisition and presentation.
Martin from Western Austrila have a good demo how rrdtool integrate to monitor linux wirless interface. martin also indicated that mrtg cannot be used to measure negative and fraction value, but rrdtool can. however, martin’s script required server to generate graphs every 5 minutes and store them into disk.
i rewrite the code and separate the task of data collection and graph generation. perl script is used to collect data and store it into rrdtool database. php will be used as a server script to generate graph on-demand. i called it drrdgraph (dynamic rrdgraph). it should be easy to integrate into your webpage or add you customer code to limit the access of graph.
here’s a screen shot of dynamic rrdgraph page. it has a similar look of mrtg!!
you’ll need…
i install redhat 8.0 on my linux box and it recogized my Orinoco siliver card during installation. however, if you have problem on wireless interface, have a look at linux wireless lan howto.
hints: support on usb-based wireless card is limited. if your desktop/laptop have pcmcia adapter, get a wireless pc card. i prefer ISA-based pcmcia adapter especially for compaq desktop as there is problem on ricoh chipset, PCI-based pcmcia adapter. trust me, i try it on my compaq already.
installation of rrdtool is straightforward. if you got rrdtool tarball, untar it and follow README instruction. if you are using redhat, simply get the rpm package and type…
rpm -Uvh rrdtool*.rpm
you should download dynamic rrdgraph, untar it under your html root document tree. four perl scripts for capturing cpu, ethernet traffic, wireless and memory usage are included as examples. you should move them to /var/rrd/ and chmod 755.
mkdir /var/rrd/ mv script/* /var/rrd/ chmod 755 /var/rrd/*
same to marty website, i also use the same rrdtool database to store wireless data such as SNR, signal, noise and link rate details. Here’s the command to create the database…
rrdtool create /var/rrd/eth1w.rrd -s 300 \
DS:snr:GAUGE:600:0:60 \
DS:signal:GAUGE:600:-105:-50 \
DS:noise:GAUGE:600:-105:-50 \
DS:rate:GAUGE:600:0:11 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:6:672 \
RRA:AVERAGE:0.5:24:732 \
RRA:AVERAGE:0.5:144:1460
four data sources (snr, signal, noise and rate) are created and this command create four aggregates too (2-day of 5-min average, 2-week of 30-min average, 2-mount of 2-hour average and 2-year of 12-hour average). please refer to rrdtool create” manpage for details explanation.
configure the following perl script eth1w.pl and make sure path and interface are good to your system.
# define location of rrdtool binary my $rrdtool = '/usr/bin/rrdtool'; # define location of rrdtool databases my $rrd = '/var/rrd/eth1w.rrd'; # define the wireless interface my $iface = 'eth1';
run the script. if it’s good, you should get the following output.
> /etc/rrd/eth1w.pl eth1 link stats: snr: 22 dB, signal: -76 dBm, noise: -98 dBm, rate: 5.5 Mbits/s
to automate the data collection, schedule the script to run every 5 minutes by setup a cron job. edit /etc/crontab and add…
# rrd # get wireless link details (snr, signal, link rate) 00-59/5 * * * * root /etc/rrd/eth1w.pl > /dev/NULL
edit config.php and make sure path is correct to your rrd database. samples for wireless, cpu, memory usage and ethernet traffic are included.
use your favourite web browser and select drrdgraph.php. a dropdown menu should be available for your selection for graph display.
it’s also easy to put the code inside your portal or add your authorization code for per user view. i integrate drrdgraph here and you could see my server statistic online.
you can use your imagination to create round robin database to store the data and display it thru my drrdgraph. commands for creating other rrdtool database are also shown here for your reference.
cpu0.rrd- three datasources are created using DERIVE. lower and upper values are set as 0 and 100 respectively (percentage).
rrdtool create /var/rrd/cpu0.rrd -s 300 \
DS:user:DERIVE:600:0:100 \
DS:nice:DERIVE:600:0:100 \
DS:system:DERIVE:600:0:100 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:6:672 \
RRA:AVERAGE:0.5:24:732 \
RRA:AVERAGE:0.5:144:1460
eth1.rrd- two datasources are created using DERIVE. lower and upper values are set as 0 and 10^6 respectively (10^6 = 1000000 = 1m).
rrdtool create /var/rrd/eth1.rrd -s 300 \
DS:in:DERIVE:600:0:1000000 \
DS:out:DERIVE:600:0:1000000 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:6:672 \
RRA:AVERAGE:0.5:24:732 \
RRA:AVERAGE:0.5:144:1460
mem.rrd- i use a single database to store main memory and swap memory so there are four datasources created as GAUGE. lower and upper values are set as 0 and 10^9 respectively (10^9 = 1000000000 = 1g). if you have more memory, set the upper limit to higher.
rrdtool create /var/rrd/mem.rrd -s 300 \
DS:memused:GAUGE:600:0:1000000000 \
DS:memfree:GAUGE:600:0:1000000000 \
DS:swapused:GAUGE:600:0:1000000000 \
DS:swapfree:GAUGE:600:0:1000000000 \
RRA:AVERAGE:0.5:1:576 \
RRA:AVERAGE:0.5:6:672 \
RRA:AVERAGE:0.5:24:732 \
RRA:AVERAGE:0.5:144:1460
you can download and integrate drrdgraph from here
you could see demo at my server statistics. let me know if you have any comment on the php!!
WLTC © 2007.
Simple Grey theme developed by Rodrigo P. Ghedin.