Nagios-plugins-maintenance

Jump to: navigation, search
check_maintenance

Icon-applications.png

Nagios plugin

Download for openSUSE

Vendor: SUSE Linux Products GmbH
Developer: lrupp
License: BSD-4-Clause
Web: Nagios-plugins-maintenance


About

check_maintenance allows you to let Nagios do the critical check, if the hardware of a given host is still in service or not.

check_maintenance will read the given file with maintenance data and checks for a line with the given hostname and service date.

If it succeeds, the service date will be processed against the given warning and critical values.

All data in the maintenance file behind the second '|' will be printed as normal output to Nagios, so you can use this to add addtional informations like the room or inventory number of the host.


Options

 -H <HOSTNAME>    | --hostname <HOSTNAME>
 -w <int>         | --warning <int>
 -c <int>         | --critical <int>
 -f <file>        | --file <file>

 -h               | --help
 -d               | --debug

Detailed options description

--hostname <hostname> The name of the host.

--critical <int> Weeks befor the check should return critical.

--warning <int> Weeks befor the check should return warning.

--file <file> Read all maintenance data from the given file. Here's the expected structure of the file:

<hostname>|<last service date>|[additional information shown in check output]

or

<hostname>|<last service date>|[Vendor]|[additional information shown in check output]

hostname should be the same as Nagios submits to the check via the $HOSTNAME$ variable. Note: all hostnames are converted to lowercase automatically.

The last service date can be one of the following formats:

  • 31.12.2010
  • 31/12/2010

Vendor is not required, it is currently just an additional output value for the comment section.

All lines without two '|' are currently ignored. Best way to mark a line as comment is a '#' at the beginning, this allows further improvements in the future.

--help Produces some help text.

--debug Print debug output on console.


Check definition

For checking a machine and their maintenance data, place a file with the maintenance information on the host running the nagios daemon, add a command definition like:

define command {
       command_name    check_maintenance
       command_line    $USER1$/check_maintenance -H $HOSTNAME$ -w8 -c4 -f <file_with_maintenance_data>
}

and define a service definition like:

 define service{
       use                             generic-service
       host_name                       my_host
       service_description             Maintenance
       normal_check_interval           1440 # once a day
       display_name                    Maintenance information
       check_command                   check_maintenance
}

See also


External links