Ubuntu 26.04

Nagios : Set Thresholds2026/06/10

 

This is the Threshold settings section.
It is set on some items by default but if you change it, configure like follows.

[1] The default thresholds are defined in the monitoring configuration file.
In the monitoring configuration file for the Nagios server's local host, each monitoring item corresponds to the section enclosed in [define service] and the parameters following the command specified in [check_command] with [!] are the thresholds.
For example, monitoring of disk usage on the root partition is configured as follows.
root@dlp:~#
vi /etc/nagios4/objects/localhost.cfg
.....
.....
# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.

define service {

    # the thresholds are set to root partition as Warning if > 20% free, critical if 10% > 10% free
    # change these values if you'd like to change them
    use                     local-service           ; Name of service template to use
    host_name               localhost
    service_description     Root Partition
    check_command           check_local_disk!20%!10%!/
}

[2] If you want to configure the new threshold setting, the process would be as follows.
root@dlp:~#
vi /etc/nagios4/objects/localhost.cfg
# add to last line
# for example, if the free space on the /tmp partition falls below 20%, 
# it will be marked as Warning, and if it falls below 10%, it will be marked as Critical
define service{
    use                     local-service
    host_name               localhost
    service_description     TMP Partition
    check_command           check_local_disk!20%!10%!/tmp
}

root@dlp:~#
systemctl reload nagios4

[3] If the threshold is exceeded, an alert will be generated.
Matched Content