Ubuntu 16.04
Sponsored Link

Munin : Set Thresholds
2016/06/06
 
The monitoring target items are set as plugins and thresholds are defined in some plugins by default, but if you'd like to add more thresholds to a plugin, configure like follows.
[1] It's possible to see plugins like follows.
# current enabled plugins are located under the directory below

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

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

# installed plugins are located under the directory below

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

acpi                      nvidia_
amavis                    open_files
apache_accesses           open_inodes
apache_processes          openvpn
apache_volume             perdition
.....
.....
[2] It's possible to display current values for each plugin.
# display values for cpu plugin

root@dlp:~#
munin-run cpu

user.value 7798
nice.value 4496
system.value 3589
idle.value 1739548
iowait.value 19460
irq.value 0
softirq.value 41
steal.value 83
guest.value 0

# display values for df plugin

root@dlp:~#
munin-run df

_run.value 1.41642779480083
_dev_mapper_ubuntu__vg_root.value 7.65805319624569
_dev_shm.value 0
_run_lock.value 0
_sys_fs_cgroup.value 0
_dev_vda1.value 22.565656742098
_run_user_0.value 0
[3] Set threshold's value in munin.conf like follows.
⇒ [plugin name].[field name].[warning | critical] min-value:max-value
The field name is just the one which is displayed when executing "munin-run" command. The min-value or max-value can be omitted.
root@dlp:~#
vi /etc/munin/munin.conf
# set threshold on target node

[dlp.srv.world]
    address 127.0.0.1
    use_node_name yes
   
# set 80% of warning and 90% of critical for user field in cpu plugin

    cpu.user.warning :80
    cpu.user.critical :90
   
# set 80% of warning and 90% of critical for root partition field in df plugin

    df._dev_mapper_ubuntu__vg_root.warning :80
    df._dev_mapper_ubuntu__vg_root.critical :90
[4] If you configured notification setting and a value is over from the threshold's value, the email is sent like follows.
Return-Path: <munin@dlp.srv.world>
X-Original-To: root@dlp.srv.world
Delivered-To: root@dlp.srv.world
Received: by dlp.srv.world (Postfix, from userid 112)
        id C464315F576; Tue,  7 Jun 2016 13:25:06 +0900 (JST)
Subject: Munin-notification for srv.world::dlp.srv.world
To: <root@dlp.srv.world>
X-Mailer: mail (GNU Mailutils 2.99.99)
Message-Id: <20160607042506.C464315F576@dlp.srv.world>
Date: Tue,  7 Jun 2016 13:25:06 +0900 (JST)
From: munin@dlp.srv.world (munin application user)

srv.world :: dlp.srv.world :: Disk usage in percent
        CRITICALs: / is 7.66 (outside range [:90]).
        OKs: /boot is 22.57, /sys/fs/cgroup is 0.00, /dev/shm is 0.00, /run/user/0 is 0.00, /run is 1.42, /run/lock is 0.00.
Matched Content
 
Tweet