Monitor Debian Server Status with Munin
Munin is a monitoring tool to survey processes and resources in 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 user to access the web interface
htpasswd -c /etc/munin/.htpasswd munin
This step will prompt for password.
Enable plugins for monitoring
Choose which plugin to be enabled by creating symbolic link to it:
ln -s /usr/share/munin/plugins/cpu /etc/munin/plugins/cpuln -s /usr/share/munin/plugins/df /etc/munin/plugins/dfln -s /usr/share/munin/plugins/forks /etc/munin/plugins/forksln -s /usr/share/munin/plugins/fw_packets /etc/munin/plugins/fw_packetsln -s /usr/share/munin/plugins/ip_127.0.0.1 /etc/munin/plugins/ip_127.0.0.1ln -s /usr/share/munin/plugins/load /etc/munin/plugins/loadln -s /usr/share/munin/plugins/memory /etc/munin/plugins/memoryln -s /usr/share/munin/plugins/processes /etc/munin/plugins/processesln -s /usr/share/munin/plugins/threads /etc/munin/plugins/threadsln -s /usr/share/munin/plugins/uptime /etc/munin/plugins/uptimeln -s /usr/share/munin/plugins/exim_mailqueue /etc/munin/plugins/exim_mailqueueln -s /usr/share/munin/plugins/exim_mailstats /etc/munin/plugins/exim_mailstatsln -s /usr/share/munin/plugins/postfix_mailstats /etc/munin/plugins/postfix_mailstatsln -s /usr/share/munin/plugins/postfix_mailqueue /etc/munin/plugins/postfix_mailqueueln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queriesln -s /usr/share/munin/plugins/nginx_request /etc/munin/plugins/nginx_requestln -s /usr/share/munin/plugins/nginx_status /etc/munin/plugins/nginx_statusln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accessesln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
Edit configuration
Edit /etc/munin/munin.conf
file for some basic settings.
Find and change [localhost.localdomain]
to your own hostname such as server1.example.com
.
Open and edit /etc/apache2/conf.d/munin
.
Comment the following lines:
Order allow,denyAllow from localhost 127.0.0.0/8 ::1Options 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 port other than 80, edit /etc/munin/plugin-conf.d/munin-node
Add following lines to the end of 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 few minutes.
Want to contribute?
You could earn up to $300 by adding new articles
Suggest an update
Request an article
Leave a Comment