Linux as server

My Sme7 howto's-

Sme -Linux gateway server-

Linux commands

Just pretty photos

SME server resources

Howto monitor your sme7 general performance using with RRDtool and collectd.

By Hans-Cees Speel (hanscees@<-remove this->hanscees.com 24 Oktober 2005

A newer version of this howto, but still untested by me, lives here: sme7systemmonitoring.html. Provided by Stig W. Jensen. Please provide feedback in the forums at www.contribs.org.
Another project I learned about recently that has performance statistics lives here. It is more easy to install and better integrated, but based on another manner to collect data. They are discussed here.

This howto lives here.
Here is what you get: take a look!

It is/was discussed here

What this howto will and will not produce:

Special thanks to Florian Forster (of collectd ) for helping me out with some initial troubleshooting. And of course to the volunteers of sme7 (www.contribs.org) for making a great platform.

The buildingblocks for this howto are collectd RRdtool. . I also used this guide to make some rpms
Collectd is a small daemon which collects system information every 10 seconds and writes the results in an RRD-file. RRD-tool is a framework which uses round-robin datbases and which has tools included to make graphical overviews. It is well supported in perl.

For your information, there are and will be fast developments on the basis of this first howto. There are newer rpm's for instance. You can find this discussed at contribs here.
However I will not update this howto with the latest and greatest everyday. Because the howto will be unstable now and then if I do that. I will post, at the bottom, some newer rpm's you can try. But please don't complain if they do not work as advertised. But do help in making the stats better. If you are great in perl we can use your help!

The howto

###############################################
#Step a: get the rpm's and install them
###############################################

##rrdtool and perl-rrd and perl-libxml-dumper for rhel4
mkdir /root/tmp
cd /root/tmp
wget ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/rrdtool-1.0.50-1.2.el4.rf.i386.rpm
wget ftp://fr.rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/perl-rrdtool-1.0.50-1.2.el4.rf.i386.rpm
wget http://ftp.debian.org/debian/pool/main/libx/libxml-dumper-perl/libxml-dumper-perl_0.79.orig.tar.gz

#install RRD rpm's
rpm -ihv rrdtool-1.0.50-1.2.el4.rf.i386.rpm
rpm -ihv perl-rrdtool-1.0.50-1.2.el4.rf.i386.rpm

#install perl-xml-dumper
tar -zxvf libxml-dumper-perl_0.79.orig.tar.gz
cd XML-Dumper-0.79
perl Makefile.PL
make
make test
make install

##install collectd and sensors:
##this is not the latest version. Improvent is possible.
##I am not sure they work for al cpu's
cd /root/tmp
wget http://www.hanscees.com/sme7/collectd-3.0.0-2.i386.rpm
wget http://www.hanscees.com/sme7/collectd-sensors-3.0.0-2.i386.rpm

rpm -ihv --nodeps collectd-3.0.0-2.i386.rpm
rpm -ihv collectd-sensors-3.0.0-2.i386.rpm

##startup collectd
collectd
##you can also do: collectd -p www.nu.nl www.somehost.nl and collectd will start pinging and making graphs of ping performance. See man collectd.

##make sure collectd is started up after a reboot:
echo "collectd" >> /etc/rc.local

#see if rrd files are there:
ls /var/lib/collectd/

##You should see a bunch of RRD files there.
###############FYI#################### #collectd files:
#RRD files in : /var/lib/collectd/
#cgi scripts and readme for them are in /usr/share/doc/collectd-3.0.0/contrib/museum
# rrd png making example shellscripts are in /usr/share/doc/collectd-3.0.0/contrib/
# see man collectd
#############################

##################################################
##Step B: install an ibay and monitor statistics from there on demand
##################################################

## The purpose of this step is to have a website you can locally visit to see your statistics.
## You can see statistics like these by doing http://yourdomain/cgi-bin/collection.cgi form a local network
## Please DO NOT make your statistics site publicly available as cgi-bin scripts are famous to get your site hacked.
## I am not saying the script used is unsafe, but it just might turn out to be. I did not research its safety

# If you already have an internal website with cgi-bin support you can use that one of course.

##make a apache dir to call the stats:
This step is for SME server gateway 7 as described here. It will work for any cgi-bin apache site however.

##that's it!

############
##Improvement
############

# 1. make a dns structure without host files
# 2. make rpm's for i586 and i686 and so on.
# 3. make a script that uses RRD shellscripts for emailing stats
# 4 place collectd in /service scripts on sme7

###################
## Where are the files
###################
If the packages are not on the internet anymore here are some
backups:
wget http://www.hanscees.com/sme7/collectd-3.0.0-2.i386.rpm
wget http://www.hanscees.com/sme7/collectd-sensors-3.0.0-2.i386.rpm
wget http://www.hanscees.com/sme7/rrdtool-1.0.50-1.2.el4.rf.i386.rpm
wget http://www.hanscees.com/sme7/perl-rrdtool-1.0.50-1.2.el4.rf.i386.rpm wget
http://www.hanscees.com/sme7/libxml-dumper-perl_0.79.orig.tar.gz wget
http://www.hanscees.com/sme7/collectd-3.0.0-2.src.rpm

###################latest rpm's (not stable):
http://www.hanscees.com/sme7/collectd-3.2.0-1.i386.rpm
http://www.hanscees.com/sme7/collectd-sensors-3.2.0-1.i386.rpm
http://www.hanscees.com/sme7/collectd-hddtemp-3.2.0-1.i386.rpm
ftp://ftp.nluug.nl/pub/os/Linux/distr/CentOS/4.2/os/alpha/CentOS/RPMS/perl-XML-Dumper-0.71-2.noarch.rpm rpm -Uvh perl-XML-Dumper-0.71-2.noarch.rpm
http://www.hanscees.com/sme7/hddtemp-0.3-0.beta12.2.2.el4.rf.i386.rpm

#####################not stable
Everything below is not yet stable, you can try it, but only for testing.
There is a part on hddtemp and on lm_sensors

#####################
# Further reading
#####################

Rrd-tool:
A round robin database structure, where the database does not grow
indefinitly:
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/doc/index.en.html

On sme see also man rrdtool

Collectd:
http://verplant.org/collectd/#description
mailing list: http://mailman.verplant.org/listinfo/collectd

On sme see man collectd

Collectd was chosen from a great many RRD-filling schemes because:
- It is small and c-based
- Therefore it can collect every 10 seconds,which is much better than cron-based things
- It does not install the bloated and relatively insecure snmp suites.
- It does what I wanted: performance and not much more.
- It is easy to install

update to latest collectd 3.2.0.1: cd /root/tmp wget http://www.hanscees.com/sme7/collectd-3.2.0-1.i386.rpm wget http://www.hanscees.com/sme7/collectd-sensors-3.2.0-1.i386.rpm wget http://www.hanscees.com/sme7/collectd-hddtemp-3.2.0-1.i386.rpm rpm -Uhv collectd-3.2.0-1.i386.rpm rpm -Uhv --nodeps collectd-3.2.0-1.i386.rpm rpm -Uhv collectd-sensors-3.2.0-1.i386.rpm rpm -Uhv collectd-hddtemp-3.2.0-1.i386.rpm [root@mail tmp]# ps wax | egrep coll 9250 ? S 8:36 collectd kill 9250 #does hddtmp run? [root@mail tmp]# ps wax | egrep hdd 28049 ? S 0:00 hddtemp -d /dev/hda yes: collectd check if new rrd's are there: ls /var/lib/collectd/ yes! hddtemp-3-0.rrd and processes.rrd ls -all /usr/share/doc/collectd-3.2.0/contrib/museum/coll* ls -all /home/e-smith/files/ibays/awstats/cgi-bin/coll* yes its changed: ls -all /home/e-smith/files/ibays/stats/cgi-bin/ cp /usr/share/doc/collectd-3.2.0/contrib/museum/* /home/e-smith/files/ibays/stats/cgi-bin/
does not work
see http://hem.bredband.net/ekmlar/vt1211.html get and patch vt1211 wget http://hem.bredband.net/ekmlar/vt1211.c echo "obj-m := vt1211.o" > Makefile make -C /path/to/your/kernel2.6/source/dir SUBDIRS=$PWD modules make -C /usr/include SUBDIRS=$PWD modules get kernel: wget http://vault.centos.org/4.1/os/SRPMS/kernel-2.6.9-11.EL.src.rpm rpm -ihv kernel-2.6.9-11.EL.src.rpm cd /usr/src/redhat/SOURCES/ tar xvjf linux-2.6.9.tar.bz2 dir is nu: /usr/src/redhat/SOURCES/linux-2.6.9 make -C /usr/src/redhat/SOURCES/linux-2.6.9 SUBDIRS=$PWD modules make -C /usr/include SUBDIRS=$PWD modules