8.2 Negating Plugin Results

In some situations you may want to test the opposite of what the standard plugin normally tests, such as an interface that should not be active, a Web page or a host that should normally not be reached. In these cases the program negate, included in the Nagios plugins, provides a way of negating the return value of the original check.

Like plugins, negate has an option to specify a timeout in seconds, with -t, after which it should abort the operation. The actual command line must always contain the complete path to the plugin:

negate plugin command
negate -t timeout plugin command

negate changes the return value of 2 (CRITICAL) to 0 (OK) and vice versa. The return codes 1 (WARNING) and 3 (UNKNOWN) remain unchanged.

The ...

Get Nagios, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.