10 Feb 2008, 10:51pm
General
by Mark

3 comments

Boy, it is 5F outside!!

Boy, it is 5F outside!!

10 Feb 2008, 9:14pm
General
by Mark

leave a comment

Since Oooops is abandoned

Here is the instructions and such from the WayBack Machine.

 

rrdtool

background…

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.

my idea…

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.

screen shot…

here’s a screen shot of dynamic rrdgraph page. it has a similar look of mrtg!!

sample graph

requirement…

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…

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/*

creating database…

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.

collecting data…

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

viewing graph…

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.

other databases used…

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

download

you can download and integrate drrdgraph from here

my server stat

you could see demo at my server statistics. let me know if you have any comment on the php!!

10 Feb 2008, 8:48pm
General:
by Mark

leave a comment

Rewrote some of the frequently generated …

Rewrote some of the frequently generated files to be cached, tweaked the mysql server some more before the load hits. Coincidentally, the Mysql Performance tuning script at http://day32.com/MySQL/ was a great starting point.

Getting two servers in the same network …

Getting two servers in the same network segment of the same datacenter (by request) is impossible through 1and1, so I moved the blog to its own server. Weirdness should subside by tomorrow, I hope.

6 Feb 2008, 4:58pm
General
by Mark

leave a comment

New SQL server coming online, that shoul …

New SQL server coming online, that should reduce some of the load times

5 Feb 2008, 10:21pm
General
by Mark

leave a comment

Now where is that troll commenter …

Now where is that troll commenter plugin when I need it?

Maybe this could become a weblogtoolscol …

Maybe this could become a weblogtoolscollection.com group Twitter. That would be interesting!

5 Feb 2008, 7:42pm
General:
by Mark

leave a comment

I received a fix for the WP-Forum issue …

I received a fix for the WP-Forum issue from a helpful reader, but I think it might be better to let people disable it until there is a fix from the author.

Free, Good & Fast

input for my blog is hard to come by. My mom told me it looked and worked great, and people who know more tend to be “for money.” Don’t get me wrong, my mom is wicked good at COBOL and dBASE.

But just like the little bee in that one music video, I know there exists a place for people just like me. If anyone has any ideas, please email me at:

or at twitter as nogrrlsallowed.  Thanks!

Just updated to wp2.3.3

I just went through and updated the blogs I run to wp 2.3.3 – nice to see them catch and release that patch so quickly.

I wonder how WordPress is handling upgra …

I wonder how WordPress is handling upgrade notifications if just the xmlrpc.php file is upgraded on the server (in this case)?

updating all wordpress installs to 2.3.3 …

updating all wordpress installs to 2.3.3.

3 Feb 2008, 7:31pm
General:
by Mark

2 comments

Really want the eeePC from Asus but I th …

Really want the eeePC from Asus but I think I am going to wait for the Everex to come out before I commit. I wish MACs weren’t so expensive!

3 Feb 2008, 6:00pm
General
by Mark

leave a comment

Found it!! That was easy?!

Found it!! That was easy?!

3 Feb 2008, 4:56pm
General
by Mark

leave a comment

Because of the unfreezing process, I hav …

Because of the unfreezing process, I have no inner monologue. ZZZzzzzzzz

I think I like CareerBuilder.com much be …

I think I like CareerBuilder.com much better than Monster.com SimplyHired.com (from LinkedIn.com) is also better than Monster. I wonder if there are any stats about “likability”.

3 Feb 2008, 1:02pm
General
by Mark

leave a comment

Error code 1000008e sucks. This 8600GT c …

Error code 1000008e sucks. This 8600GT card is starting to get on my nerves. I might have to RMA it.

Still looking for the elusive Paypal Ban …

Still looking for the elusive Paypal Banner Plugin for WordPress

2 Feb 2008, 8:21pm
General
by Mark

leave a comment

Why is Bad Behaviour so SQL intensive??

Why is Bad Behaviour so SQL intensive??

Spam bots are really starting to suck ag …

Spam bots are really starting to suck again. I am going to have to look to purchase another MySql server. Arrrgghhh!

2 Feb 2008, 5:24pm
General
by Mark

leave a comment

I really like the idea of having my own …

I really like the idea of having my own twitter. Checking out OpenAds and BTDSoft Paypal plugin. I wonder if I can write something like that on my own without having to spend oodles of time on it.

2 Feb 2008, 5:19pm
General:
by Mark

leave a comment

This is interesting. Testing Prologue

This is interesting. Testing Prologue