4

I am trying to get munin to notify me via email. I have configured munin and it reports critical and warning values but no alerts are being sent neither is any script being called. Can you please help me out with this?

I have included part of the munin.conf below

# Drop [email protected] and [email protected] an email everytime 
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
#contact.someuser.command mail -s "Munin notification" [email protected]\

contact.prashanth.command echo "Munin notification" | sendmail -t [email protected]
contact.prashanth.always_send warning critical

contact.root.command echo "Munin notification" | sendmail -t [email protected]
contact.root.always_send warning critical

contact.pipevia.command | /home/prashanth/script.sh /home/prashanth/script.sh

None of this works. Here is the munin-limits.log

2011/09/26 14:58:12 Opened log file
2011/09/26 14:58:12 [INFO] Starting munin-limits, getting lock /var/run/munin/munin-limits.lock
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $res[3] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $res[15] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $res[1] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 722.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 725.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 740.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 754.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $a[0] in pattern match (m//) at /usr/share/perl5/Munin/Master/LimitsOld.pm line 759.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $text in length at /usr/share/perl5/Munin/Master/LimitsOld.pm line 774.
2011/09/26 14:58:12 [PERL WARNING] Use of uninitialized value $res[1] in join or string at /usr/share/perl5/Munin/Master/LimitsOld.pm line 777.
2011/09/26 14:58:12 Baz?
2011/09/26 14:58:12 [INFO] munin-limits finished (0.02 sec)
2011/09/26 14:58:12 Command "prashanth" stderr: Munin notification - this is a test mail from the user prashanth | sendmail -t [email protected]

What am I missing here and why are emails not being sent?

3 Answers 3

9

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}" [email protected]
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
2

It seems like your config doesn't match the example from the munin.conf file. The example is:

contact.someuser.command mail -s "Munin notification" [email protected]

And you have:

contact.prashanth.command echo "Munin notification" | sendmail -t [email protected]

I would expect something like this to work:

contact.prashanth.command mail -s "Munin notification" [email protected]
0

I had the same issue, seems like a quoting issue, the following worked for me:

contact.prashanth.command 'echo "Munin notification" | sendmail -t [email protected]'

You must log in to answer this question.