Notificação por e-mail de Munin

3

Estou tentando fazer com que munin me notifique por e-mail. Eu configurei o munin e ele reporta valores críticos e de aviso, mas nenhum alerta está sendo enviado e nenhum script está sendo chamado. Você pode por favor me ajudar com isso?

Eu incluí parte do munin.conf abaixo

# 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

Nada disso funciona. Aqui está o 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]

O que estou perdendo aqui e por que os e-mails não estão sendo enviados?

    
por masegaloeh 26.09.2011 / 09:35

3 respostas

9

Há duas coisas que você precisa definir para Munin enviar alertas. Se ambos os itens não estiverem definidos, os e-mails não serão enviados. É assim que eu tenho Munin configurado para enviar e-mail via localhost na máquina em que o Munin está rodando. Por favor, compare com o que você tem & ajustar de acordo:

contact.myalert.command mail -s "MUNIN - ${var:group} :: ${var:host}" [email protected]
contact.myalert.always_send warning critical

E, sob a árvore de host, eu tenho essa configuração. Observe a linha contacts myalert :

# a simple host tree
[localhost.localdomain]
    address 127.0.0.1
    use_node_name yes
    contacts myalert
    
por 10.11.2013 / 04:23
2

Parece que sua configuração não corresponde ao exemplo do arquivo munin.conf. O exemplo é:

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

E você tem:

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

Espero que algo assim funcione:

contact.prashanth.command mail -s "Munin notification" [email protected]
    
por 26.09.2011 / 16:00
0

Eu tive o mesmo problema, parece um problema de citação, o seguinte funcionou para mim:

contact.prashanth.command 'echo "Munin notification" | sendmail -t [email protected]'
    
por 12.10.2016 / 15:41