Nagios threshold configuration

This is the Threshold settings section.

The thresholds are set in configuration file by default. For example, the item for monitoring disk usage of root partition is set like follows.

#vi /etc/nagios/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.


# the thresholds are set as Warning if > 20% free, critical if 10% > 10% free

# change these values if you'd like to change them

define service{

        use                       local-service

        host_name                 localhost

        service_description       Root Partition

        check_command             check_local_disk!20%!10%!/

        }


reload after changing settings

#/etc/rc.d/init.d/nagios reload


For the case you add a new plugin and configure for it all, set like follows. (the example is a case for adding check_ntp_time plugin)

# /usr/lib64/nagios/plugins/check_ntp_time -h

...

...

 -w, --warning=THRESHOLD

    Offset to result in warning status (seconds)

 -c, --critical=THRESHOLD

...

...


#vi /etc/nagios/objects/commands.cfg

# add follows to the end

define command{

        command_name    check_ntp_time

        command_line    $USER1$/check_ntp_time -H $ARG1$ -w $ARG2$ -c $ARG3$

        }

    

#vi /etc/nagios/objects/localhost.cfg

# add follows to the end ( Warning if it has 1 sec time difference, Critical if it has 2 sec )

define service{

        use                             local-service

        host_name                       localhost

        service_description             NTP_TIME

        check_command                   check_ntp_time!ntp1.jst.mfeed.ad.jp!1!2

        notifications_enabled           1

        }

And, the notification is sent if a system value is over the threshold.




Relevant Blogs:

Nagios Configure Alerts 

Nagios triggers 

Beginners guide for Jenkins pipeline 

chef cookbooks

Recent Comments

No comments

Leave a Comment