Munin

From WebarchDocs
Jump to navigation Jump to search

We have a Webarchitects Munin server in Sheffield and a Ecodissident Munin server in Iceland, we provide access to these servers to clients running our virtual machiones and cal also offer access to clients with servers not hosted by us if needs be.

The following notes are for debian, if you are using another distro the package names might vary.

Install

First install the Munin client, LWP (this is needed for the Apache stats) and Cache::Cache (this is needed by the mysql_ plugins)

aptitude install munin-node libwww-perl libcache-cache-perl

Configure

You need to allow the Munin servers to connect, edit /etc/munin/munin-node.conf and add the IP address of our Munin server after the section for localhost:

allow ^127\.0\.0\.1$
# https://ecodissident.net/munin/
allow ^93\.95\.226\.170$
# https://munin.webarch.net/
allow ^81\.95\.52\.102$

You then need to contact us to ask that we add your server to the list we monitor.

Plugins

Then you can enable and disable additional plugins by creating and deleting sym links in the /etc/munin/plugins/ directory, for example:

cd /etc/munin/plugins/
ln -s /usr/share/munin/plugins/apache_accesses 
ln -s /usr/share/munin/plugins/apache_processes 
ln -s /usr/share/munin/plugins/apache_volume

You can test that the plugin is working like this:

munin-run apache_volume
volume80.value 223695872

If the apache plugins are not working it is probably because you need to create a localhost VirtualServer, for example create /etc/apache2/sites-available/localhost containing:

<VirtualHost *:80>
        ServerName localhost
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Location /server-status>
               SetHandler server-status
               Order allow,deny
               Allow from 127.0.0.1 ::1
        </Location>
        DocumentRoot /var/www
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from 127.0.0.1 ::1 
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/localhost.error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/localhost.access.log combined
</VirtualHost>

And then enable it:

a2ensite localhost

You might also need to add the following to /etc/munin/plugin-conf.d/munin-node:

[apache_*]
env.url   http://localhost:%d/server-status?auto
env.ports 80
env.showfree 1

Some plugins require additional configuration, for example multips, which tracks memory usage by application:

cd /etc/munin/plugins/
ln -s /usr/share/munin/plugins/multips_memory

Then edit /etc/munin/plugin-conf.d/munin-node and add a section at the end with the applications you want tracked, for example:

[multips_memory]
env.names apache2 mysqld

After adding any plugins you need to restart the munin node:

/etc/init.d/munin-node restart