Ubuntu 26.04

Munin : メール通知の設定2026/06/10

 

監視対象となる項目はプラグインで設定します。
CPU 使用率等の主要なプラグインはデフォルトで有効、且つ、しきい値も設定されていますが、このしきい値に対して値を超えた際にコマンドを実行するよう設定することができます。この機能を利用して通知メールを送信するも可能です。

[1]

メールでの通知をする場合は、使用可能な SMTP サーバーが必要となります。
当例ではローカルホストで SMTP サーバーが稼働していることを前提に設定します。

[2] root 宛てに通知メールを送信するよう設定します。
root@dlp:~#
apt -y install mailutils
root@dlp:~#
vi /etc/munin/munin.conf
# 87行目あたりに追記

contact.email.command mail -s "Munin-notification for ${var:group}::${var:host}" root
# 通知メールを強制送信

root@dlp:~#
su - munin --shell=/bin/bash -c "/usr/share/munin/munin-limits --contact email --force"

root@dlp:~#
mail

"/var/mail/root": 1 message 1 new
>N   1 munin application  Wed Jun 10 00:24  33/1375  Munin-notification for srv.world::dlp.srv.world
? 1
Return-Path: <munin@dlp.srv.world>
X-Original-To: root
Delivered-To: root@dlp.srv.world
Received: by dlp.srv.world (Postfix, from userid 105)
        id 63601604E3; Wed, 10 Jun 2026 00:24:47 +0000 (UTC)
Subject: Munin-notification for srv.world::dlp.srv.world
To: root@dlp.srv.world
User-Agent: mail (GNU Mailutils 3.20)
Date: Wed, 10 Jun 2026 00:24:47 +0000
Message-Id: <20260610002447.63601604E3@dlp.srv.world>
From: munin application user <munin@dlp.srv.world>

srv.world :: dlp.srv.world :: Disk latency per device :: Average latency for /de
v/ubuntu-vg/ubuntu-lv
        OKs: Write IO Wait time is unknown, Read IO Wait time is unknown.

srv.world :: dlp.srv.world :: Disk latency per device :: Average latency for /de
v/vda
        OKs: Read IO Wait time is unknown, Write IO Wait time is unknown.

srv.world :: dlp.srv.world :: File table usage
        OKs: open files is 1299.00.

srv.world :: dlp.srv.world :: Inode usage in percent
        OKs: / is 6.25, /run is 0.09, /boot is 0.26, /dev/shm is 0.00, /tmp is 0
.00.

srv.world :: dlp.srv.world :: enp1s0 errors
        OKs: errors is unknown, errors is unknown.

srv.world :: dlp.srv.world :: Disk usage in percent
        OKs: /run is 0.15, / is 25.95, /tmp is 0.00, /boot is 5.36, /dev/shm is
0.00.

srv.world :: dlp.srv.world :: Munin processing time
        OKs: munin update is unknown, munin graph is unknown: Can't open /var/log/munin/munin-graph.log for reading.
[3] メール送信ではなくログファイルに書き出す場合は以下のように設定します。
root@dlp:~#
vi /etc/munin/munin.conf
# 87行目あたりに追記

contact.log.command tee -a /var/log/munin/alert.log
関連コンテンツ