web-dev-qa-db-ja.com

ムニンのメール通知

私はメールでmuninに通知するようにしています。 muninを構成しましたが、重要な値と警告値を報告しますが、アラートは送信されず、スクリプトも呼び出されません。これを手伝ってくれませんか。

以下にmunin.confの一部を含めました

# 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

これはどれも機能しません。これが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]

ここで何が欠けているのですか、なぜメールが送信されないのですか?

4
Prashanth

Muninがアラートを送信するために設定する必要があるものが2つあります。両方が設定されていない場合、メールは送信されません。これは、Muninが実行されているマシンでlocalhostを介して電子メールを送信するようにMuninを構成した方法です。持っているものと比較して、それに応じて調整してください:

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

次に、ホストツリーの下にこの設定があります。 contacts myalert行に注意してください。

# a simple Host tree
[localhost.localdomain]
    address 127.0.0.1
    use_node_name yes
    contacts myalert
9
JakeGould

設定がmunin.confファイルの例と一致していないようです。例は次のとおりです。

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

そして、あなたは持っています:

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

私はこのようなものが機能することを期待します:

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

私は同じ問題を抱えていました、引用問題のようですが、次のことがうまくいきました:

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