Skip to content
Davide Madrisan edited this page Oct 9, 2015 · 17 revisions

Nagios Plugins for Linux

A suite of Nagios plugins for monitoring Linux servers and appliances

Nagios is an open source computer system monitoring, network monitoring and infrastructure monitoring software application. Nagios, originally created under the name NetSaint, was written and is currently maintained by Ethan Galstad along with a group of developers who are actively maintaining both the official and unofficial plugins.

The Nagios Plugins for Linux are intended to be run by NRPE, the Nagios Remote Plugin Executor, that "allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.)."

Available Nagios Plugins

LNX_CLOCK - returns the number of seconds elapsed between local time and Nagios time

[/etc/nrpe.d/check_clock]
command[check_clock]=/usr/lib/nagios/plugins/check_clock --refclock $ARG1$ -w 60 -c 120

where $ARG1$ is the number of secondss since the "Epoch" (1970-01-01 00:00:00 UTC) -- $(date '+%s') provided by the Nagios poller.

Usage note

This check is intended for alerting when the number of seconds elapsed between the Nagios poller and the monitored server exceeds a given threshold (60 seconds for the warning state, and 120 seconds for a critical notification, in the example above). The clock of the Nagios server needs, of course, to be synchronized to an NTP server.

This plugin returns the number of seconds elapsed between the host local time and Nagios time. Copyright (C) 2014 Davide Madrisan [email protected]

Usage:
  check_clock [-w COUNTER] [-c COUNTER] --refclock TIME

Options:
  -r, --refclock COUNTER  the clock reference (in seconds since the Epoch)
  -w, --warning COUNTER   warning threshold
  -c, --critical COUNTER  critical threshold
  -v, --verbose   show details for command-line debugging
                  (Nagios may truncate output)
  -h, --help      display this help and exit
  -V, --version   output version information and exit

Examples:
  check_clock -w 60 -c 120 --refclock $ARG1$

  # where $ARG1$ is the number of seconds since the Epoch: "$(date '+%s')"
  # provided by the Nagios poller
Example of output
clock OK - time delta 39s | clock_delta=39
Performance data

clock_delta