Linux server monitoring tools.

Some days ago we have started another portal, and the customer informed me about huge spam action, more than 60m spam emails, so we expected a huge traffic and a great stress testing. So the task is to determine if our current hardware and software is able to handle this kind of load.

The first thing came to my mind is setting up monitoring tools. After googling some time I've found some freeware tools. The most interesting were munin and nagios.

The first one installed on my server was nagios. The installation was pretty simple using standard configurations (in my case Ubuntu 6.06 server), following by great documentation http://www.onlamp.com/pub/a/onlamp/2002/09/26/nagios.html?page=1.
On the official site I found lots of features, but in real system I didn't found that I need.

I was looking for CPU and memory charts. So, I moved to another tool - munin
Well, installation was simple too, following the instructions found at http://www.ubuntugeek.com/monitoring-servers-and-clients-using-munin-in-ubuntu.html
One thing is missed in tutorial is apache configuration, but it's pretty simple.

Everything you need is setup account and add munin configuration to apache enabled sites


cd /var/www/munin
nano .htaccess

#.htaccess
AuthUserFile /etc/munin/munin-htpasswd
AuthName "D"
AuthType Basic
require valid-user
# EOF

htpasswd -c /etc/munin/munin-htpasswd muinin_username
nano /etc/apache2/sites-available/munin.conf

#munin.conf
ScriptAlias /munin/cgi/ /var/www/munin/cgi/
Alias /munin/ /var/www/munin/
#EOF

a2ensite munin
/etc/init.d/apache restart


And that is actually it. Open http://you-server-ip/munin and you can see the server load by days, weeks. So you know the peak of system load, can analyze it and make something to prevent server crushing.