Munin

From Noah.org
Revision as of 13:22, 12 October 2012 by Root (talk | contribs)
Jump to navigationJump to search

Munin is about a million times easier to get working than Cacti. It's also trivial to write plugin extensions for the munin-node.

Munin-node is much easier to install using Apt or another package manager. It has many Perl dependencies :-(

apt-get install munin-node

Double-check that it included sym links to the plugins:

root@www.example.com: /etc/munin/plugins # ls -l
total 116
drwxr-xr-x  2 root root 4096 Aug 28 15:51 ./
drwxr-xr-x  4 root root 4096 Aug 28 15:51 ../
lrwxrwxrwx  1 root root   41 Aug 28 15:51 apache_processes -> /usr/share/munin/plugins/apache_processes*
lrwxrwxrwx  1 root root   28 Aug 28 15:51 cpu -> /usr/share/munin/plugins/cpu*
lrwxrwxrwx  1 root root   27 Aug 28 15:51 df -> /usr/share/munin/plugins/df*
lrwxrwxrwx  1 root root   30 Aug 28 15:51 forks -> /usr/share/munin/plugins/forks*
lrwxrwxrwx  1 root root   32 Aug 28 15:51 if_err_eth0 -> /usr/share/munin/plugins/if_err_*
lrwxrwxrwx  1 root root   28 Aug 28 15:51 if_eth0 -> /usr/share/munin/plugins/if_*
lrwxrwxrwx  1 root root   35 Aug 28 15:51 interrupts -> /usr/share/munin/plugins/interrupts*
lrwxrwxrwx  1 root root   31 Aug 28 15:51 iostat -> /usr/share/munin/plugins/iostat*
lrwxrwxrwx  1 root root   29 Aug 28 15:51 load -> /usr/share/munin/plugins/load*
lrwxrwxrwx  1 root root   31 Aug 28 15:51 memory -> /usr/share/munin/plugins/memory*
lrwxrwxrwx  1 root root   32 Aug 28 15:51 netstat -> /usr/share/munin/plugins/netstat*
lrwxrwxrwx  1 root root   34 Aug 28 15:51 processes -> /usr/share/munin/plugins/processes*
lrwxrwxrwx  1 root root   29 Aug 28 15:51 swap -> /usr/share/munin/plugins/swap*
lrwxrwxrwx  1 root root   31 Aug 28 15:51 vmstat -> /usr/share/munin/plugins/vmstat*

Use `update-rc.d` under Ubuntu/Debian or under RedHat use `chkconfig`:

# chkconfig --add munin-node
# chkconfig munin-node on
# chkconfig --list munin-node
munin-node      0:off   1:off   2:on    3:on    4:on    5:on    6:off

Start munin-node:

/etc/init.d/munin-node start

munin-node.conf

By default munin-node is configured to only allow connections from localhost (127.0.0.1). I usually modify it to allow connections from any machine on a localnet.

allow ^127\.0\.0\.1$
# localnets
# 192.168.0.0/16
allow ^192\.168\.\d+\.\d+$
# 172.16.0.0/12
allow ^172\.(1[6-9]|2[0-9]|3[01])\.\d+\.\d+$
# 10.0.0.0/8
allow ^10\.\d+\.\d+\.\d+$

munin server

apt-get install munin

Edit /etc/munin/munin.conf and set htmldir. Make sure to create the htmldir and set ownership to munin:munin.

Edit /etc/crontab and add this line:

*/5 * * * * munin /usr/bin/munin-cron