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.
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.