Monitoring Debian Server Status Using Munin

Munin is an online resource monitoring tool that can help analyze resource trends and “what just led to a decrease in our productivity?” Problems. It is designed to be very plug and play. The default setting provides many graphs with virtually no work.

Install The Necessary Packages

apt-get install munin munin-plugins-extra libwww-perl apache2-utils

Create a User To Access The Web Interface

htpasswd -c /etc/munin/.htpasswd munin

Enable Monitoring Plugins

Next, you should choose the plugin that will be included, while creating a symbolic link for it

ln -s /usr/share/munin/plugins/cpu /etc/munin/plugins/cpu
ln -s /usr/share/munin/plugins/df /etc/munin/plugins/df
ln -s /usr/share/munin/plugins/forks /etc/munin/plugins/forks
ln -s /usr/share/munin/plugins/fw_packets /etc/munin/plugins/fw_packets
ln -s /usr/share/munin/plugins/ip_127.0.0.1 /etc/munin/plugins/ip_127.0.0.1
ln -s /usr/share/munin/plugins/load /etc/munin/plugins/load
ln -s /usr/share/munin/plugins/memory /etc/munin/plugins/memory
ln -s /usr/share/munin/plugins/processes /etc/munin/plugins/processes
ln -s /usr/share/munin/plugins/threads /etc/munin/plugins/threads
ln -s /usr/share/munin/plugins/uptime /etc/munin/plugins/uptime
ln -s /usr/share/munin/plugins/exim_mailqueue /etc/munin/plugins/exim_mailqueue
ln -s /usr/share/munin/plugins/exim_mailstats /etc/munin/plugins/exim_mailstats
ln -s /usr/share/munin/plugins/postfix_mailstats /etc/munin/plugins/postfix_mailstats
ln -s /usr/share/munin/plugins/postfix_mailqueue /etc/munin/plugins/postfix_mailqueue
ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries
ln -s /usr/share/munin/plugins/nginx_request /etc/munin/plugins/nginx_request
ln -s /usr/share/munin/plugins/nginx_status /etc/munin/plugins/nginx_status
ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accesses
ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes

Change Configuration

First you need to edit the /etc/munin/munin.conf file for some basic settings. Then find and change [localhost.localdomain] your own hostname, for example your-server.example.com. Open and edit /etc/apache2/conf.d/munin.

Comment on the following lines:

Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
Options None

Then uncomment the following lines to enable authentication:

# AuthUserFile /etc/munin/.htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user

IMPORTANT! If your Apache web server is listening on a port that is different from 80, then you should definitely edit /etc/munin/plugin-conf.d/munin-node. Add the following lines to the end of the file if your Apache is listening on port 8080:

[apache_*]
env.ports 8080

The final step will be to restart the services

/etc/init.d/munin-node restart
/etc/init.d/apache2 restart

If all the steps are completed correctly, now you can access the munin web interface http://YOUR_SERVER_IP/munin

Was this article helpful?

Related Articles

Leave A Comment?