Debian 13 trixie

Nagios : Add Monitoring Target Item2025/10/03

 

In addition to the default monitored items, you can add various other items to be monitored.
You can create and add your own check programs, but many are also available as plugin packages, making it easy to add major items to be monitored.
The following site offers many plugins that are not provided as packages.
⇒ https://www.nagios.org/downloads/nagios-plugins/

[1] Many plugins are provided like follows.
root@dlp:~#
ll /usr/lib/nagios/plugins

total 2708
-rwxr-xr-x 1 root root  60168 Apr 22 23:25 check_apt
-rwxr-xr-x 1 root root   2337 Apr 22 23:25 check_breeze
-rwxr-xr-x 1 root root  60552 Apr 22 23:25 check_by_ssh
lrwxrwxrwx 1 root root      9 Apr 22 23:25 check_clamd -> check_tcp
-rwxr-xr-x 1 root root  43592 Apr 22 23:25 check_cluster
-rwxr-xr-x 1 root root 110472 Apr 22 23:25 check_curl
-rwxr-xr-x 1 root root  60200 Apr 22 23:25 check_dbi
-rwxr-xr-x 1 root root  64168 Apr 22 23:25 check_dhcp
.....
.....

# additional plugins can be used by installing the following packages

root@dlp:~#
apt search monitoring-plugins-contrib

monitoring-plugins-contrib/stable 48.20250420 amd64
  Plugins for nagios compatible monitoring systems
[2] For example, add the time difference with the NTP server as a monitoring item.
# check the usage of [check_ntp_time] plugin

root@dlp:~#
/usr/lib/nagios/plugins/check_ntp_time -h

.....
.....

 -w, --warning=THRESHOLD
    Offset to result in warning status (seconds)
 -c, --critical=THRESHOLD
    Offset to result in critical status (seconds)

.....
.....

root@dlp:~#
vi /etc/nagios4/objects/commands.cfg
# add to last line : set command definition
define command{
    command_name    check_ntp_time
    command_line    $USER1$/check_ntp_time -H $ARG1$ -w $ARG2$ -c $ARG3$
}

root@dlp:~#
vi /etc/nagios4/objects/localhost.cfg
# add to last line
# time difference with the NTP server [10.0.0.10] is 1 second, warning,
# the difference is 2 seconds, critical
define service{
    use                             generic-service
    host_name                       localhost
    service_description             NTP_TIME
    check_command                   check_ntp_time!10.0.0.10!1!2
}

root@dlp:~#
systemctl reload nagios4

[3] It's possible to view the status for a new plugin on the admin site.
Matched Content