Monitoring with Munin on OpenBSD

    

Quoting it’s website, “Munin is a networked resource monitoring tool (…)”.
It’s like Cacti but smaller, faster, …

It is based on a client/server configuration. By default, you install the “client” part on the host you want to monitor and install the “server” part on the host that will keep the data and do the graphics.

Here’s the way I installed, configured and run it on OpenBSD 4.9.

Munin node

First, install the “client” part:

# pkg_add munin-node

Configure the Apache server to allow statistics grabbing:

# vi /var/www/conf/httpd.conf
(...)
ExtendedStatus On
(...)
<location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</location>
(...)
# apachectl stop
# apachectl startssl

If this Apache server runs WordPress with permalinks on, you’ll have to modify the .htaccess file:

# vi /var/www/www.tumfatig.net/.htaccess
(...)
# Apache server-status
RewriteCond %{REQUEST_URI} !=/server-status
(...)

Now, configure the “client” part :

# vi /etc/munin/munin-node.conf
(...)
host_name bagheera.tumfatig.net
(...)
# cd /etc/munin/plugins
# /usr/local/sbin/munin-node-configure --shell
(...)
# /etc/rc.d/munin_node start

You can either copy/paste the commands from munin-node-configure or run

# /usr/local/sbin/munin-node-configure --shell | sh

to have all links done automatically.

Munin server

Install the “server” part:

# pkg_add munin-server

Configure the “server” part:

# vi /etc/munin/munin.conf
(...)
htmldir /var/www/www.tumfatig.net/munin
(...)
[bagheera.tumfatig.net]
    address 127.0.0.1
    use_node_name yes
(...)
# chown _munin:www /var/www/www.tumfatig.net/munin

Start the “server” part via the cron process:

# crontab -e
*/5     *       *       *       *       sudo -u _munin /usr/local/bin/munin-cron

Now browse to the URL defined in munin.conf.
Here’s what it would look like: