2016/05/18

How To Install the Munin Monitoring Tool on Ubuntu 14.04

Munin Monitoring Server 1

1.sudo su
2.apt-get update
3.apt-get install -y apache2 apache2-utils
4.apt-get install -y libcgi-fast-perl libapache2-mod-fcgid
5./usr/sbin/apachectl -M | grep -i cgi < Check output display should be "fcgid_module (shared)" >

optional command: a2enmod fcgid < If step 5 is fail >

6.apt-get install -y munin
7.gedit /etc/munin/munin.conf
8.Find these lines to remove # and modify to "htmldir   /var/www/munin"

dbdir     /var/lib/munin
htmldir   /var/www/munin
logdir    /var/log/munin
rundir    /var/run/munin

tmpldir /etc/munin/templates
9.mkdir /var/www/munin
10.chown munin:munin /var/www/munin
11.gedit /etc/munin/munin.conf
12.Modify the configuration as below:

[localhost.localdomain]
    address 127.0.0.1
    use_node_name yes

to

[Server 1]
    address 127.0.0.1
    use_node_name yes

Note: [Server 1] = you can type any name which you want to display on website.

13.gedit /etc/munin/apache.conf
14.Modify the configuration as below:

Alias /munin /var/www/munin

<Directory /var/www/munin>
        Order allow,deny
        Allow from all

        Require all granted
        Options FollowSymLinks SymLinksIfOwnerMatch

<Location /munin-cgi/munin-cgi-graph>
        Order allow,deny
        Allow from all

        Require all granted
        Options FollowSymLinks SymLinksIfOwnerMatch

<Location /munin-cgi/munin-cgi-html>
        Order allow,deny
        Allow from all

        Require all granted
        Options FollowSymLinks SymLinksIfOwnerMatch

15.service apache2 restart
16.service munin-node restart

Munin Monitoring Server 2

1.apt-get update
2.apt-get install -y munin-node
3.gedit /etc/munin/munin-node.conf
4.Find this line and modify to Server 1 IP address.

allow ^192\.168\.xxx\.xxx$

5.ufw allow 4949/tcp < open firewall port >
6.service munin-node restart
7.Back to Server 1
8.gedit /etc/munin/munin.conf
9.Add Server 2 configuration

[Server 2]
    address 192.168.xxx.xxx
    use_node_name yes

10.service apache2 restart

Munin Monitoring - Enable Extra Plugins

1.munin-node-configure --suggest
2.Check output display like below

Plugin                  | Used | Suggestions
------                     | ---- | -----------
cps_                     | no   | no
cpu                       | yes  | yes

3.ln -s /usr/share/munin/plugins/fail2ban /etc/munin/plugins
4.service munin-node restart

Munin Monitoring - Troubleshooting

Server 1: /var/log/munin/munin-update.log
Server 2: /var/log/munin/munin-node.log

Reference link: How To Install the Munin Monitoring Tool on Ubuntu 14.04

沒有留言:

張貼留言