Wednesday, July 21, 2010

Overriding Munin's Plugins Default Configuration

One of the best aspects of munin is its ease of configuration. The drawbacks to this is that sometimes you will get informations you may wish to complete; "Wireless" may be more precise than eth1, "NAS share" more informational than /dev/sdb3. This is made possible by munin with the overriding, on a per-node basis, of some configuration data of the plugins.

Alright, let's assume on your computer eth1 corresponds to your wireless network. The graph concerning the bandwidth usage on that interface is generated by the plugin if_eth1 (all the plugins are in /usr/share/munin/plugins; it is fairly easy with the name to guess which plugin produces which graph).

We need to get the output of the config for that plugin. We have seen before how to do that with telnet, this time we will connect directly to the server with munin-node installed and use munin-run - the result is exactly the same, only this time you execute the operation locally.


serverA $ sudo -u munin munin-run if_eth1 config
graph_order down up
graph_title eth1 traffic
graph_args --base 1000
graph_vlabel bits in (-) / out (+) per ${graph_period}
graph_category network
graph_info This graph shows the traffic of the eth1 network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: Since the data source for this plugin use 32bit counters, this plugin is really unreliable and unsuitable for most 100Mb (or faster) interfaces, where bursts are expected to exceed 50Mbps. This means that this plugin is usuitable for most production environments. To avoid this problem, use the ip_ plugin instead.
down.label received
[...]


The element we want to override here is the variable graph_title. This is done on the server with munin (serverX), in the munin.conf. Find the node referring to the server for which you want to do the modification, and add the line concerning that value:


[domain;serverA]
address aaa.aaa.aaa.aaa
use_node_name yes
if_eth1.graph_title Wireless traffic




This should already be enough :) You can also overwrite the other variables returned by config, like the description (graph_info), which can be useful to add special informations, like "the disk is getting full, but it's fine, we already ordered a new one" or being more precise in describing how monitoring the entropy of a system can be useful...


No comments:

Post a Comment