Monitor Debian Server Status with Munin

Munin is a monitoring tool to survey processes and resources on your machine and presents the information in graphs through a web interface.

Use the following steps to setup Munin on your machine and view your web interfaces with Apache.

Install Required 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

This step will prompt for the password.

Enable Plugins For Monitoring

Choose which plugin to enable by creating a symbolic link to 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

Edit Configuration

Edit the /etc/munin/munin.conf file for some basic settings.

Find and change [localhost.localdomain] to your hostname, such as server1.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

Extras

If your Apache is listening on a port other than 80, edit /etc/munin/plugin-conf.d/munin-node

Add the following lines to the end of the file if your Apache is listening to port 8080:

[apache_*]
env.ports 8080

Finish

Finally, restart your services.

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

You can now access your Munin web interface at http://YOUR_SERVER_IP/munin.

The Munin graphs will be available after a few minutes.

We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies

More