Overview

check_uptrack is a Nagios plugin that allows you to monitor out-of-date and inactive machines. It uses the Uptrack API to determine whether updates are available and not installed.

Downloading the Plugin

The Uptrack Nagios plugin, check_uptrack, is shipped as a part of the Uptrack API Python bindings. After installation, the script will be located in /usr/lib/nagios/plugins.

Installation instructions for package managers and for installing manually are provided.

Configuring the Plugin

To configure the Nagios plugin, place your API username and API key in the file /etc/uptrack-api.conf on the machine the plugin will run on, in the following format:

[uptrack]
username = joeuser
api_key  = 3af3c2c1ec407feb0fdc9fc1d8c4460c

Your username and API key can be retrieved from your settings page.

If you need to configure internet access through a proxy, you can configure one in uptrack-api.conf using a line like:

https_proxy = http://proxy.example.com:3128/

The proxy string should be of the form [protocol://][username:password@]<host>[:port], where

  • protocol is the protocol to connect to the proxy (http or https)
  • username and password are the authentication information needed to use your proxy (if any).
  • host and port are the hostname/ip address and port number used to connect to the proxy
  • The proxy must support making HTTPS connections.

You then need to configure the plugin in Nagios. An example minimal configuration for running the plugin directly might look like:

# Dummy host to associate the Uptrack service with
define host {
       host_name                       uptrack-service
       notifications_enabled           0
       max_check_attempts              1
       notification_interval           0
       check_period                    never
       contacts                        server-admins
}

define service {
       host_name                       uptrack-service
       service_description             Ksplice Uptrack Update Status
       check_command                   check_uptrack
       notifications_enabled           1
       normal_check_interval           60
       retry_check_interval            15
       max_check_attempts              4
       notification_options            w,c,r
       contacts                        server-admins
}

define command {
       command_name     check_uptrack
       command_line     /usr/lib/nagios/plugins/check_uptrack
}

define command {
       command_name     check_uptrack_opts
       command_line     /usr/lib/nagios/plugins/check_uptrack -w $ARG1$ -c $ARG2$
}

Monitoring all of your machines

The minimal way to monitor all of your machines is to just run:

# /usr/lib/nagios/plugins/check_uptrack

This produces a summary about your machines using the standard nagios plugin format. A summary might look like this:

2 machines are OUTOFDATE!|uptodate=1280;outofdate=1;unsupported=0;inactive=3
prod1.foobar.com (192.168.1.1) is OUTOFDATE
prod2.foobar.com (192.168.1.2) is OUTOFDATE

By default, the plugin will produce a CRITICAL status if any machine is missing any updates. To configure this, you can pass the -w and -c options to check_uptrack. Each option should be a comma-separated string containing zero or more of the choices o, u, and i, for out of date, unsupported, and inactive machines, respectively. For example:

# /usr/lib/nagios/plugins/check_uptrack -w u,i -c o

Will return WARNING if you have any machines that are running unsupported kernels or have uninstalled Ksplice Uptrack or otherwise not checked in recently, and CRITICAL if any machines are out of date.

Monitoring the local machine

Uptrack 1.1.0 includes a separate Nagios plugin to monitor the local machine. It accepts the same -w and -c options as check_uptrack. This plugin can be run as:

# /usr/lib/nagios/plugins/check_uptrack_local

check_uptrack_local uses only the local Uptrack update cache already present on the machine, so no additional configuration is necessary.

check_uptrack_local will generate a similar summary to check_uptrack, but for out-of-date machines, will also report a list of the updates needed to bring the current machine up to date.