All Linux HowTo's

Munin Email Notifications – Different emails to different people

Send emails to different people for different servers (nodes) with Munin. Here is an example from a working “/etc/munin/munin.conf” file:

contact.web_group.command mail -s "MUNIN - ${var:group} :: ${var:host}" web_group@agix.local
contact.web_group.always_send warning critical

contact.db_group.command mail -s "MUNIN - ${var:group} :: ${var:host}" db_group@agix.local
contact.db_group.always_send warning critical

contact.itgroup.command mail -s "MUNIN - ${var:group} :: ${var:host}" itgroup@agix.local
contact.itgroup.always_send warning critical

### Contact Groups

[web_servers;]
        contacts web_group

[db_servers;]
        contacts db_group itgroup

### Servers

[web_servers;web-01]
        address 192.168.122.5
        use_node_name yes

[web_servers;web-02]
        address 192.168.122.6
        use_node_name yes

[db_servers;db-01]
        address 192.168.122.7
        use_node_name yes

In the above section of the ‘/etc/munin/munin.conf’ file, we have three email addresses (which could be distribution lists) that will receive emails for specific server issues. Ie, if a web server has issues, the notification will go to ‘web_group@agix.local’. And if a database server has an issue, the notification will go to both ‘db_group@agix.local’ and ‘itgroup@agix.local’.

Similar Posts: