1

I'm using the resource monitoring tool Munin. (Version 1.4.6)

Today I've enabled the email alert function to receive a notification when a value is too high.

With munin it is possible to set two levels of alerting. (Warning or Critical)

I've configured the munin.conf file like this:

contact.scs.command mail -s "Munin notification ${var:host}" simon@domain.net

[varnish;server01.domain.net]
  address server01.domain.net
  use_node_name yes
  cpu.iowait.warning 14
  cpu.iowait.critical 17
  cpu.contacts scs

When a performance value exceeds the defined maximum, a mail notification with the alert will be successfully send. :-)

Now to my Question:

Would it be possible to send a critical notification to a different mail address than the warning notification?

Unfortunately I couldn't find anything at web.

I've already tried this, but it didn't work for me:

contact.scs.command mail -s "Munin notification ${var:host}" simon@domain.net
contact.crit.command mail -s "Munin notification ${var:host}" critical@domain.net

[varnish;server01.domain.net]
  address server01.domain.net
  use_node_name yes
  cpu.iowait.warning 14
  cpu.iowait.critical 17
  cpu.contacts scs
  cpu.contacts.warning scs
  cpu.contacts.critical crit

Thanks for help!

Deltahost
  • 107
  • 3
  • 11
  • Also looking for the same thing. I want warnings to go to my notification tab in gmail but I want criticals to go into the main tab. – hchinchilla Feb 05 '14 at 20:46

2 Answers2

0

Here's a guess for you. For all the warning-only contacts:

contact.scs.command mail -s "Munin notification ${var:host}" simon@domain.net
contact.scs.always_send warning

For all the critical-only contacts:

contact.crit.command mail -s "Munin notification ${var:host}" critical@domain.net
contact.crit.always_send critical

For any warning-and-critical contacts:

contact.other.command mail -s "Munin notification ${var:host}" other@domain.net
contact.other.always_send warning critical
josephdpurcell
  • 1,157
  • 3
  • 16
  • 34
  • Hi josephdpurcell, The always_send command is for a different usage. That makes that munin always send messages even if the state didn't change since previous run. See also: http://munin-monitoring.org/wiki/munin.conf What I need is something that controls the notification behaviour in general. Thank you anyway! – Deltahost Sep 26 '13 at 11:31
0

Unfortunately munin doesn't support this and its documentation is very poor. But it's possible to do it via workaround. My case below is little bit more complicated, I have to first ssh to another machine, since in my case mail cannot be sent directly from munin machine. But it's of course possible to simplify it without using ssh.

contact.email.command ssh user@10.20.30.40 "cat > /tmp/muninmail.txt; bash -c \"if grep -q CRITICAL /tmp/muninmail.txt; then cat /tmp/muninmail.txt | mail -s 'Munin-notification for ${var:group} :: ${var:host}' mail@domain.net; fi\"

Without ssh, something like this should do it, but I haven't tested this case:

contact.email.command bash -c "cat > /tmp/muninmail.txt; if grep -q CRITICAL /tmp/muninmail.txt; then cat /tmp/muninmail.txt | mail -s 'Munin-notification for ${var:group} :: ${var:host}' mail@domain.net; fi"
aver
  • 109
  • 1
  • 4