Table of Contents
munin.conf
munin.conf is the configuration file for all scripts of Munin master. When pre-packaged, it's usually located in /etc/munin/, while if compiled from source it is often found in /etc/opt/munin/. The programs using it are munin-update, munin-graph, munin-limits and munin-html.
Structure
The configuration file consists of the following:
- One general/global section
- Zero or more group section(s)
- One or more host section(s)
Group and host sections are defined by declaring the group or host name in brackets. Everything under a section definition belongs to that section, until a new group or host section is defined. As the global section is not defined through brackets, it must be found prior to any group or host sections.
Sample munin.conf
The format of the file is simple. A minimal configuration looks something like:
# Configfile for Munin master
dbdir /var/lib/munin
htmldir /var/www/munin
logdir /var/log/munin
rundir /var/run/munin
# This is an example of the correct way to activate Nagios warnings
contact.nagios.command /usr/local/nagios/bin/send_nsca nagioshost.example.com -c /usr/local/nagios/etc/send_nsca.cfg -to 60
# From and including the first host, no more global directives can be defined.
# Everything after one host definition belongs to that host, until another host definition is found.
[foo.example.com] # Defines the group "example.com" and then
# "foo.example.com" under that group.
address localhost # The address (IP or host name) of the host, where munin-node is running.
[example.com;bar.example.com] # Same as above, but with an explicit definition.
# of the host's group.
address bar.example.com # The address.
df.contacts no # Don't warn Nagios (or whatever) if the 'df' plugin exceed warning values.
[Groupname;] # Defines the group "Groupname"
contacts nagios # Notifications shall go to nagios for hosts in this group
[Groupname;baz.example.com] # Associates the host baz.example.com to this group
address baz.example.com # The address of the host, where munin-node is running.
update no # Specifies that no services on this host should be updated by munin-update
Directives
Global directives
| Directive | Explanation | Required | Default value |
| dbdir | Base directory for all rrd files (files go into $dbdir/$domain/) | Yes | |
| htmldir | Where pngs and html files end up. | Yes | |
| logdir | Where to send logs. | Yes | |
| rundir | Where to put state files. | Yes | |
| tmpldir | Where the templates reside. | ||
| fork | If set, run updates of several hosts simultaneously. | Yes | |
| max_processes | Set max number of simultaneous Munin-update processes. | as many processes as necessary | |
| nsca* | DEPRECATED. Use contact directives instead, and see Sending alerts from Munin. | ||
| domain_order | Change the order of domains/groups. | Alphabetically sorted | |
| max_graph_jobs | Maximum number of parallel processes used by munin-graph when calling rrdgraph. Available since Munin 1.4.0 | 6 | The optimal number is very hard to guess and depends on the number of cores of CPU, the I/O bandwidth available, if you have SCSI or (S)ATA disks and so on. You will need to experiment. Set on the command line with the -n n option. Set to 0 for no forking. |
| max_cgi_graph_jobs | Maximum number of concurrent/parallel. munin-cgi-graph or munin-fastcgi-graph jobs. | 6 | Should probably be the same as max_graph_jobs |
| local_address | Sets the local IP address that munin-update should bind to when contacting the nodes. May be used several times (one line each) on a multi-homed host. | No | Should default to the most appropriate interface based on routing decision, if you don't set it explicitly. |
| contact.contact.command command | Define which contact command to run. | ||
| contact.contact.text text | Text to pipe into the command. | ||
| contact.contact.max_messages number | Close (and reopen) command after given number of messages. E.g. if set to 1 for an email target, Munin sends 1 email for each warning/critical. Useful when relaying messages to external processes that may handle a limited number of simultaneous warnings. | Unlimited | |
| contact.contact.always_send [warning] [critical] | Always send messages with a state that is mentioned. | ||
| contacts contact-list | A list of the available contacts to use by default. | Defaults to all contacts with a command definition. | |
| [bar;example.com;foo.example.com] | Add the node foo.bar.com to group example.com which is again under the group bar. (Available since version 1.3.4) | ||
| [example.com;foo.example.com] | Add the node foo.bar.com to group example.com. | ||
| [foo.example.com] | Add the host foo.example.com to group example.com. (A short form of [example.com;foo.example.com].) |
These last three entries begin the appropriate host section in the config file. (CHECKME)
Previously a htaccess directive was mentioned here. This was a documentation bug. Munin does not and will not implement a htaccess directive.
To add a new host, just add the address directive (and other directives if necessary).
For detailed information on the contact directives, see Sending Alerts from Munin.
Group level directives
Note: This level was previously called the domain level.
| Directive | Explanation | Required | Default value |
| node_order | Changes order of hosts in a domain. | Alphabetically sorted. | |
| local_address | Sets the local IP address that munin-update should bind to when contacting the nodes. May be used several times (one line each) on a multi-homed host. | No | Should default to the most appropriate interface, based on routing decision. |
| contacts | Enables (by naming contacts) or disables ("no") warnings through external system | All defined contacts |
Node level directives
| Directive | Explanation | Required | Default value |
| address | Sets the node IP address | Yes | |
| local_address | Sets the local IP address that munin-update should bind to when contacting the nodes. May be used several times (one line each) on a multi-homed host. | No | Should default to the most appropriate interface, based on routing decision. |
| port | Sets node port number | 4949 | |
| use_node_name | You will almost never want to set this to anything. Defaults to "no". | ||
| contacts | Enables (by naming contacts) or disables ("no") warnings through external system | All defined contacts | |
| notify_alias | Changes the name by which the node presents itself when warning through munin-limits | ||
| update | Deactivate munin-update for this host? Then set value to no | No | yes |
Plugin level directives
All plugins configuration of Data source attributes can be overwritten via directives in munin.conf.
| Directive | Explanation | Required | Default value |
| sum | Summarize other fields. See the FAQ and the aggregate examples for how to use this. | ||
| stack | Stack other fields. See the FAQ and the stack examples for how to use this. | ||
| +++ | Check the node configuration (further up) for everything else. | ||
| contacts | Enables (by naming contacts) or disables ("no") warnings through external system | All defined contacts | |
| notify_alias | Changes the name by which the plugin presents itself when warning through munin-limits | ||
| graph_order | Changes the order in the data sources will be graphed. Also enables loaning data from other data sources. | The order in which the data sources appear in the plugin |
Fieldname level directives
FIXME.
| Directive | Explanation | Required | Default value | Format |
| warning | Set warning level for munin-limits. | plugin value (if defined) | lower limit:upper limit | |
| critical | Set critical level for munin-limits. | plugin value (if defined) | lower limit:upper limit | |
| graph | Dictates whether the fieldname should be included in the graph. | yes |
Note that contacts may NOT be set on fieldname level.
