9.6. Munin systemstatistics server


It might take 5-10 minutes before changes to the Munin configurationsfiles are taken into effect.

If you point your browser to the url http://tjener.intern/munin you will see that Munin is already running on your , albeit not yet properly configured. You should see something like this:

Figure 9-11. Unconfigured Munin

I use the following convention, "Server" is the machine that gathers and displays the statistics, in a Skolelinux/Debian-edu network that is usually the Mainserver, "clients" are the machines that we want to monitor. There is two things we need to configure, setting up the clients so that the Mainserver can be allowed to gather the data, and telling the Mainserver which clients it should monitor. We should also make Munin use a more appropriate name than localhost, replace the following stanza in the file /etc/munin/munin.conf

    use_node_name yes
with something like

    use_node_name yes
Now that we have meaningful names, lets tell Munin which clients it should monitor. If you have a Thin Client server, with the "correct" ip-address of, then adding the following stanza to the file /etc/munin/munin.conf on the Mainserver will make Munin start monitoring that client:

    use_node_name yes
Now we need to tell the client that the server is allowed to gather statistics, we do this by adding an extra line at the end of the file /etc/munin/munin-node.conf on the client:

allow ^10\.0\.2\.2$


When you have made changes to the file /etc/munin/munin-node.conf on the client, you must restart Munin with the command

/etc/init.d/munin-node restart

After a few minutes you should see something like this:

Figure 9-12. Munin with Mainserver and Thin Client server

9.6.1. SNMP Munin plugin

Some devices are SNMP capable, and there is no need for munin-node to be installed on such a device. SNMP capable devices include printers, embedded firewalls, routers and wireless accesspoints.

I personally use the FreeBSD based m0n0wallfirewall/router as my Skolelinux/Debian-edu router, to get Munin to monitor it, I first enable SNMP on the firewall, with the community string set to public. Then you need to add a line to the file /etc/munin/munin-node.conf on the server

allow ^10\.0\.2\.2
And also these two lines to the file /etc/munin/munin.conf



Note that eventhough the address of the device you want to monitor in this case is, you still must use the address of the server here, in this case

Now you must setup the Munin SNMP-plugins, you do this easiest with the included command

munin-node-configure-snmp gateway

In my case when run against my firewall, I get this in return:

tjener:~# munin-node-configure-snmp gateway
ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_gateway_if_err_1
ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_gateway_if_err_2
ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_gateway_if_1
ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_gateway_if_2
You are now supposed to copy and paste these four lines above, but make sure than you modify it a little bit, so that it includes the domain intern, like this:

tjener:~# ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_gateway.intern_if_err_1
tjener:~# ln -s /usr/share/munin/plugins/snmp__if_err_ /etc/munin/plugins/snmp_gateway.intern_if_err_2
tjener:~# ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_gateway.intern_if_1
tjener:~# ln -s /usr/share/munin/plugins/snmp__if_ /etc/munin/plugins/snmp_gateway.intern_if_2
After you have made changes to the file /etc/munin/munin-node.conf you must restart munin-node with

/etc/init.d/munin-node restart

After a few minutes, sometimes it takes as much as 10 minutes before anything happens, you should see something like this at http://tjener.intern/munin/intern/gateway.intern.html

If you would like to test the SNMP capabilities of any of your devices, try running

snmpwalk -v 1 -c public

You might be rewarded with something rather meaningless like this, which is a good sign:

tjener:~# snmpwalk -v 1 -c  public
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.
SNMPv2-MIB::sysUpTime.0 = Timeticks: (9102780) 1 day, 1:17:07.80
SNMPv2-MIB::sysContact.0 = STRING:


If you when running munin-node-configure-snmp see something like this:

Can't locate Net/SNMP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) 
at /usr/sbin/munin-node-configure-snmp line 29.
BEGIN failed--compilation aborted at /usr/sbin/munin-node-configure-snmp line 29.
then you are quit possibly missing some necessary perl stuff, I'm sure apt-get install libnet-snmp-perl will fix this.


It's also possible to use Munin together with SNMP to monitor Windows-machines.