System load monitoring on SME Server 7

By Stig W. Jensen, Denmark

Purpose

Generate a statistical overview on the server system like the MRTG System Monitor that is used on SME Server 5 & 6. This include temperature on server and harddiscs and a decent graphics for easy error identification

More information

This has only been possible due to great work by others. For reference and inspiration see the following:

Similar work for SME Server 7 by Hans-Cees Speel; http://www.hanscees.com/sme7/collectd4sme7howto.html

Automated setup for SME Server 6 by Jesper Swert-Knudsen: http://sme.swerts-knudsen.com/howtos/howto_6.htm

Collectd deamon made by Florian Forster: http://verplant.org/collectd/

General information on the excellent SME server homepage on: http://contribs.org

Howto discussion: http://contribs.org/modules/pbboard/viewtopic.php?t=29362&start=0&postdays=0&postorder=asc&highlight=

Software and installation

In order to achieve the wanted system monitoring a number of software packages needs to be in place. This software in general consists of the following:

lm_sensors

hddtemp

rrdtools

collectd

These packages are covered in the following description by individual howto’s including how to present result on a SME Server 7.


lm_sensors” on SME Server 7

By Stig W. Jensen, Denmark

Purpose

A Collection of modules for general SMBus access and hardware monitoring like CPU temperature and FAN speed

More information

A collection of links and tips:

                             Have a good and thorough look in your BIOS regarding FAN speed and CPU temp. for reference.

                             As lm_sensors is contained in SME Server 7 use “man lm_sensors” for how-to information

                             Use http://www.lm-sensors.nu for general information and check for compatibility.

                             On use of command “sensors-detect”, save this is a file and check the result in details.

                             Refer to the /etc/sensors.conf for adjusting details after the use of “sensors-detect”

Software and installation

This software is part of the SME Server 7 installation (SME7Pre3): lm_sensors-2.8.7-2.40.3

You can check for installation by the use of RPM command like:

rpmqa | grep sensors”

Configuration

The configuration can be split in to parts. First identify and start relevant modules.

This is done using the command “sensors-detect”. In my case the following was the result.

To make the sensors modules behave correctly, add these lines to

/etc/modules.conf:

#----cut here----

# I2C module options

alias char-major-89 i2c-dev

#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----

# I2C adapter drivers

modprobe i2c-sis630

modprobe i2c-isa

# I2C chip drivers

modprobe eeprom

modprobe it87

# sleep 2 # optional

/usr/bin/sensors -s # recommended

#----cut here----

I did a sanity check using “lspci”, but the suggestion seemed fair, and for my SME Server I translated this to the following add-on:

In /etc/modprobe.conf (As we are using 2.6.x kernel):

alias char-major-89 i2c-dev”

In /etc/rc.local (You can add these by hand for a check)

modprobe i2c-sis630”

modprobe ic2-isa”

modprobe eeprom

modprobe it87”

When configured and server has been restarted, you can check that modules has been started using the command

lsmod

If successful you are ready for configuration of details if result differs from expected. First check the result by the use of the command

sensors

Compare the output with the similar information from your BIOS and adjust /etc/sensors.conf accordingly. Repeat until you are satisfied with all the results.


hddtemp” on SME Server 7

By Stig W. Jensen, Denmark

Purpose

A small utility that gives you the temperature of your hard disc by reading S.M.A.R.T. information on drives supporting this.

More information

A collection of links and tips:

                             Use http://www.guzu.net/linux/hddtemp.php for general information and check for compatibility.

                             Use the command “hddtemp –h” for information

                             Refer to “hddtemp -b” for a list of supported drives

Software and installation

This software is not included on the SME Server but needs to be downloaded and installed. I found a version for RHEL4 using rpmfind.net under rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS. Downloaded using

Mkdir /root/tmp

cd /root/tmp

wget ftp://rpmfind.net/..PATH../Hddtemp-0.3-0.beta14.1.2.el4.rf.rpm”

Installed using RPM

“RPM –ivh hddtemp*

Check for installation using RPM as in

“RPM –qa | grep hddtemp

Configuration

Hddtemp can be used as an utility and as a daemon. First check functionality by using the utility. In my case I checked my two ATA drives by following commands

hddtemp /dev/hda

hddtemp /dev/hdb

Each resulting in a line showing the name of my harddiscs and a temperature like

/dev/hda: SAMSUNG SP1614N: 37şC

If ok then install as daemon using

hddtemp –d /dev/hda /dev/hdb

Check result by telnet to daemon as in (and with result below)

telnet localhost 7634”

|/dev/hdb|SAMSUNG SP1614N|37|C|Connection closed by foreign host.

For my SME Server I configured the following in /etc/rc.local for startup as I have two ATA drives

hddtemp –d /dev/hda /dev/hdb


RRDTool on SME Server 7

By Stig W. Jensen, Denmark

Purpose

Data logging and graphic application where RRD is short for Round Robin Database as data will not expand over time.

More information

A collection of links and tips:

Use http://people.ee.ethz.ch/~oetiker/webtools/rrdtools/ for general information.

Use “man rrdtool” for details.

Software and installation

This software is not included on the SME Server but needs to be downloaded and installed. I found a version for RHEL4 using rpmfind.net under rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS. Downloaded using

Mkdir /root/tmp

cd /root/tmp

wget ftp://rpmfind.net/..PATH../rrdtool-1.0.50-3.2.el4.rf.rpm”

wget ftp://rpmfind.net/..PATH../perl-rrdtool-1.0.50-3.2.el4.rf.rpm”

Installed using RPM

“RPM ivh rrdtool*”

“RPM –ivh perl-rrdtool*”

Check for installation using RPM as in

“RPM qa | grep rrdtool

Configuration

This application framework is used from the collectd daemon and I will leave the testing to that.

 


collectd” on SME Server 7

By Stig W. Jensen, Denmark

Purpose

Collectd is a small daemon that collects system information every 10 seconds and writes the results in an RRD-file.

Depending on configuration it can collect information like

Battery status and usage (on portable)

CPU frequency and usage

Partition usage

Disk usage

Harddisk temperatures (using hddtemp)

System load

Memory usage

MySQL statistics

NFS utilization

Network latency and traffic

Process count

System temperatures (using lm_sensors)

Serial port traffic

Swap usage

Users logged in

More information

A collection of links and tips:

Use http://verplant.org/collectd/ for general information.

Read /usr/share/collectd-3.7.0/contrib./museum

Use “man collectd” for details

Use “collectd –h” for basic information

Be sure not to add several daemons – check using top or..

Software and installation

This software is not included on the SME Server but needs to be downloaded and installed. I found a version for RHEL4 on verplan.org/collectd/. Downloaded using

Mkdir /root/tmp

cd /root/tmp

wget http://verplant.org/collectd/collectd-3.7.0-1.rhel4.rpm”

wget http://verplant.org/collectd/collectd-sensors-3.7.0-1.rhel4.rpm”

When trying to install I was asked for a “libxml-dumper-perl”. I checked http://www.hanscees.com/sme7 resulting in a recommendation on a XML-Dumper-0.79.tar.tar. (I found one for RHEL4 without noticing the address but one can be found on hanscees homepage)

Mkdir /root/tmp

cd /root/tmp

wget PATH.. XML-Dumper-0.79.tar.tar”

tar zxvf XML-Dumper-0.79.tar.tar”

“cd XML-Dumper-0.79

perl Makefile.PL”

make

make test”

make install”

When done collectd was installed as:

rpm -ihv –-nodeps collectd-3*”

rpm -ihv collectd-sensors*”

Checking installation using

rpmqa | grep collectd

Configuration

Configuration is done using /etc/collectd.conf where you remove “#” on each part of information that you are interested in. Like:

LoadPluging cpu

Furthermore it is possible to add details on plugins (ping or mysql) like

<Plugin ping>

           Host 10.0.1.1

</Plugin>

In my case I have the following collectd.conf

Mode       Local

DataDir    /var/lib/collectd

PIDFile    /var/run/collectd.pid

PluginDir  /usr/lib/collectd

 

#LoadPlugin battery (Not a notebook)

LoadPlugin cpu

#LoadPlugin cpufreq (Not functioning on my system)

LoadPlugin df

LoadPlugin disk

LoadPlugin hddtemp

LoadPlugin load

LoadPlugin memory

#LoadPlugin nfs (No NFS on my system)

LoadPlugin ping

LoadPlugin processes

#LoadPlugin serial (No serial)

LoadPlugin swap

#LoadPlugin tape (No tape)

LoadPlugin traffic

LoadPlugin users

#LoadPlugin mysql (Not interested)

LoadPlugin sensors

 

<Plugin ping>

           Host x.x.x.a

           # WS 1 – replace x.x.x.a with ip address

           Host x.x.x.b

           # WS 2 – replace x.x.x.b with ip address

           Host x.x.x.c

           # Router – replace x.x.x.c with ip address

           Host x.x.x.d

           # ISP – replace x.x.x.d with ip address

</Plugin>

 

When you have configured collectd.conf, you start the collecd daemon using:

collectd –C /etc/collectd.conf

Check for results as rrd files and error messages using:

ls /var/lib/collectd

tail /var/log/messages”

If needed, delete old rrd files, reconfigure collectd.conf and finally restart using:

“/etc/init.d/collectd restart”

For my SME Server I configured the following in /etc/rc.local for startup:

collectd –C /etc/collectd.conf


How to show your statistics on a SME Server 7

By Stig W. Jensen, Denmark

Purpose

Make a website that you can visit locally in order to see your statistics and using an ibay for this purpose.

More information

A collection of links and tips:

                             Use http://contribs.org for general information

Software and installation

All necessary software is included in SME Server 7 or has been collected as part of the previous how to’s

Configuration

Create an ibay using SME server-manager and configure the following parameters:

Name: stats

Description: System statistics

Group: admin

User access: Write=group, Read = everyone

Public access: Local network

Execution of dynamic content: enabled

Make a “fake” domain to which you can bind the ibay in server-manager. Configure:

Domain name: homestat.com

Brief description: Statistic area

Content: System statistics

Domain DNS servers: Resolve locally

Copy the collectd cgi-script from collectd to your ibay

cp /usr/share/doc/collectd-3.7.0/contrib/museum/* /home/e־smith/files/ibays/stats/cgi-bin/”

Check for success

ls –all /home/e-smith/files/ibays/stats/cgi-bin”

Check for success from browser on workstation

http://homestat.com/cgi-bin/collection.cgi

Make an html file named index.html that redirect to the collection.cgi

touch /home/e-smith/files/ibays/stats/html/index.html”

Use your favourite editor or just mc and make index.html contain the following:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>

<HTML>

<HEAD>

<TITLE>SME statistics</TITLE>

<META HTTP-EQUIV=”REFRESH” content=”0;url=/cgi-bin/collection.cgi”>

</HEAD>

<BODY>

</BODY>

</HTML>

Check for success from browser on workstation

http://homestat.com

In my case this shows around 29 different RRD graphs