There are two things you need to set for Munin to send out alerts. If both items are not set, mails will not be sent. This is how I have Munin configured to send e-mail via localhost
on the machine Munin is running on. Please compare to what you have & adjust accordingly:
contact.myalert.command mail -s "MUNIN - ${var:group} :: ${var:host}" mymail@domain.com
contact.myalert.always_send warning critical
And then under the host tree I have this setup. Note the contacts myalert
line:
# a simple host tree
[localhost.localdomain]
address 127.0.0.1
use_node_name yes
contacts myalert
It seems that you need to define your contacts twice. One definition to be notified only by email and another definition to be notified by both email and phone.
define contact{
name generic-contact-high
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email,notify-service-by-phone
host_notification_commands notify-host-by-email
register 0
}
define contact{
name generic-contact-med
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0
}
Your contacts should be defined according to these two types of contacts:
define contact{
contact_name sam-high
use generic-contact-high
alias Sam
email sam[...]
address1 +44[...]
}
define contact{
contact_name sam-med
use generic-contact-med
alias Sam
email sam[...]
address1 +44[...]
}
Best Answer
Edit the
nagios.cfg
to change the rotation method to daily:then parse the
nagios.log
for the CRITICAL alerts, something like this:Run the above command at the end of day as a daily cron job if you want.