wiki:munin.conf

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

DirectiveExplanationRequiredDefault value
dbdirBase directory for all rrd files (files go into $dbdir/$domain/)Yes
htmldirWhere pngs and html files end up.Yes
logdirWhere to send logs.Yes
rundirWhere to put state files.Yes
tmpldirWhere the templates reside.
forkIf set, run updates of several hosts simultaneously. Yes
max_processes Set max number of simultaneous Munin-update processes. Should be no higher than 4 x CPU cores. 16
nsca*DEPRECATED. Use contact directives instead, and see Sending alerts from Munin.
domain_orderChange the order of domains/groups. Alphabetically sorted
max_graph_jobsMaximum number of parallel processes used by munin-graph when calling rrdgraph. Available since Munin 1.4.06The 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_jobsMaximum number of concurrent/parallel. munin-cgi-graph or munin-fastcgi-graph jobs.6Should probably be the same as max_graph_jobs
local_addressSets 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.NoShould default to the most appropriate interface based on routing decision, if you don't set it explicitly.
contact.contact.command commandDefine which contact command to run.
contact.contact.text textText to pipe into the command.
contact.contact.max_messages numberClose (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. Enabling this tells munin-limits to spam you even if the state didn't change since previous run.
contacts contact-listA 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.

DirectiveExplanationRequiredDefault value
node_orderChanges order of hosts in a domain. Alphabetically sorted.
local_addressSets 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.NoShould default to the most appropriate interface, based on routing decision.
contactsEnables (by naming contacts) or disables ("no") warnings through external system All defined contacts

Node level directives

DirectiveExplanationRequiredDefault value
addressSets the node IP addressYes
local_addressSets 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.NoShould default to the most appropriate interface, based on routing decision.
portSets node port number 4949
use_node_nameYou will almost never want to set this to anything. Defaults to "no". See use_node_name
contactsEnables (by naming contacts) or disables ("no") warnings through external system All defined contacts
notify_aliasChanges the name by which the node presents itself when warning through munin-limits
updateDeactivate munin-update for this host? Then set value to noNoyes

Plugin level directives

All plugins configuration of Data source attributes can be overwritten via directives in munin.conf.

DirectiveExplanationRequiredDefault value
sumSummarize other fields. See the FAQ and the aggregate examples for how to use this.
stackStack other fields. See the FAQ and the stack examples for how to use this.
+++Check the node configuration (further up) for everything else.
contactsEnables (by naming contacts) or disables ("no") warnings through external system All defined contacts
notify_aliasChanges the name by which the plugin presents itself when warning through munin-limits
graph_orderChanges 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.

DirectiveExplanationRequiredDefault valueFormat
warningSet warning level for munin-limits. plugin value (if defined) lower limit:upper limit
criticalSet critical level for munin-limits. plugin value (if defined) lower limit:upper limit
graphDictates whether the fieldname should be included in the graph. yes

Note that contacts may NOT be set on fieldname level.

Last modified 11 months ago Last modified on 10/17/13 17:28:05