Ubuntu 24.04

Munin : しきい値の設定2026/03/13

 

監視対象となる項目はプラグインで設定します。
CPU 使用率等の主要なプラグインはデフォルトで有効、且つ、いくつかの項目はしきい値も設定されていますが、このしきい値を追加・変更したい場合は以下のように設定します。

[1] プラグインは以下で確認できます。
# 現在有効なプラグインは以下の場所に配置されている

root@dlp:~#
ls /etc/munin/plugins

cpu        entropy        if_enp1s0      load         open_inodes  threads
df         forks          if_err_enp1s0  memory       proc_pri     uptime
df_inode   fw_packets     interrupts     munin_stats  processes    users
diskstats  http_loadtime  irqstats       open_files   swap         vmstat

# インストール済みのプラグインは以下の場所に保管されている

root@dlp:~#
ls /usr/share/munin/plugins

acpi                      perdition
amavis                    pgbouncer_connections
apache_accesses           pgbouncer_requests
apache_processes          ping_
apache_volume             plugin.sh
apc_envunit_              plugins.history
apc_nis                   pm3users_
apt                       pop_stats
apt_all                   port_
.....
.....
[2] 現在有効な各プラグインは、手動実行することで現在の値を表示可能です。
# cpu プラグインを実行

root@dlp:~#
munin-run cpu

user.value 2303
nice.value 910
system.value 1352
idle.value 251856
iowait.value 1884
irq.value 0
softirq.value 8
steal.value 0
guest.value 0

# df プラグインを実行

root@dlp:~#
munin-run df

_dev_mapper_ubuntu__vg_ubuntu__lv.value 41.4795309381076
_dev_shm.value 0
_run.value 0.265410788050528
_run_lock.value 0
_dev_vda2.value 21.0699231341433
[3] しきい値の設定は、munin.conf 内の監視対象ノードのセクション内で、以下のような書式で設定します。
⇒ [プラグイン名].[フィールド名].[warning | critical] 下限値:上限値
フィールド名は [2] の例のように、プラグインを手動実行した際に表示される各値の名称のドット前の部分です。
なお、値に指定する下限値と上限値は、いずれかを省略可能です。
root@dlp:~#
vi /etc/munin/munin.conf
# 対象ノードに閾値設定
[dlp.srv.world]
    address 127.0.0.1
    use_node_name yes
    # cpu プラグインの user フィールドの使用率が 80% 超過で warning, 90% 超過で critical
    cpu.user.warning :80
    cpu.user.critical :90
    # /tmp パーティションの使用率が 80% 超過で warning, 90% 超過で critical
    df._run.warning :80
    df._run.critical :90

root@dlp:~#
systemctl restart munin
[4] メール通知を設定した状態で、設定したしきい値を超えると以下のようなメールが送信されます。
Return-Path: <munin@dlp.srv.world>
X-Original-To: root
Delivered-To: root@dlp.srv.world
Received: by dlp.srv.world (Postfix, from userid 110)
        id CF7916812E; Fri, 13 Mar 2026 00:15:04 +0000 (UTC)
Subject: Munin-notification for srv.world::dlp.srv.world
To: root@dlp.srv.world
User-Agent: mail (GNU Mailutils 3.17)
Date: Fri, 13 Mar 2026 00:15:04 +0000
Message-Id: <20260313001504.CF7916812E@dlp.srv.world>
From: munin application user <munin@dlp.srv.world>

srv.world :: dlp.srv.world :: Disk usage in percent
        CRITICALs: /run is 98.06 (outside range [:90]).
        OKs: /dev/shm is 0.00, /run/lock is 0.00, / is 41.48, /boot is 21.07.
関連コンテンツ