diff options
Diffstat (limited to 'plugins/negate.c')
| -rw-r--r-- | plugins/negate.c | 83 |
1 files changed, 49 insertions, 34 deletions
diff --git a/plugins/negate.c b/plugins/negate.c index d08c3a30..76bb6bbb 100644 --- a/plugins/negate.c +++ b/plugins/negate.c | |||
| @@ -1,20 +1,33 @@ | |||
| 1 | /****************************************************************************** | 1 | /****************************************************************************** |
| 2 | 2 | * | |
| 3 | This program is free software; you can redistribute it and/or modify | 3 | * Nagios negate plugin |
| 4 | it under the terms of the GNU General Public License as published by | 4 | * |
| 5 | the Free Software Foundation; either version 2 of the License, or | 5 | * License: GPL |
| 6 | (at your option) any later version. | 6 | * Copyright (c) 2002-2006 nagios-plugins team |
| 7 | 7 | * | |
| 8 | This program is distributed in the hope that it will be useful, | 8 | * Last Modified: $Date$ |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * Description: |
| 11 | GNU General Public License for more details. | 11 | * |
| 12 | 12 | * This file contains the negate plugin | |
| 13 | You should have received a copy of the GNU General Public License | 13 | * |
| 14 | along with this program; if not, write to the Free Software | 14 | * License Information: |
| 15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 15 | * |
| 16 | 16 | * This program is free software; you can redistribute it and/or modify | |
| 17 | $Id$ | 17 | * it under the terms of the GNU General Public License as published by |
| 18 | * the Free Software Foundation; either version 2 of the License, or | ||
| 19 | * (at your option) any later version. | ||
| 20 | * | ||
| 21 | * This program is distributed in the hope that it will be useful, | ||
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 24 | * GNU General Public License for more details. | ||
| 25 | * | ||
| 26 | * You should have received a copy of the GNU General Public License | ||
| 27 | * along with this program; if not, write to the Free Software | ||
| 28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 29 | * | ||
| 30 | * $Id$ | ||
| 18 | 31 | ||
| 19 | @@-<article> | 32 | @@-<article> |
| 20 | 33 | ||
| @@ -55,7 +68,7 @@ | |||
| 55 | 68 | ||
| 56 | const char *progname = "negate"; | 69 | const char *progname = "negate"; |
| 57 | const char *revision = "$Revision$"; | 70 | const char *revision = "$Revision$"; |
| 58 | const char *copyright = "2002-2004"; | 71 | const char *copyright = "2002-2006"; |
| 59 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 72 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
| 60 | 73 | ||
| 61 | #define DEFAULT_TIMEOUT 9 | 74 | #define DEFAULT_TIMEOUT 9 |
| @@ -239,8 +252,9 @@ print_help (void) | |||
| 239 | 252 | ||
| 240 | printf (COPYRIGHT, copyright, email); | 253 | printf (COPYRIGHT, copyright, email); |
| 241 | 254 | ||
| 242 | printf (_("\ | 255 | printf ("%s\n", _("Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).")); |
| 243 | Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).\n\n")); | 256 | |
| 257 | printf ("\n\n"); | ||
| 244 | 258 | ||
| 245 | print_usage (); | 259 | print_usage (); |
| 246 | 260 | ||
| @@ -248,20 +262,20 @@ Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).\n\n")) | |||
| 248 | 262 | ||
| 249 | printf (_(UT_TIMEOUT), DEFAULT_TIMEOUT); | 263 | printf (_(UT_TIMEOUT), DEFAULT_TIMEOUT); |
| 250 | 264 | ||
| 251 | printf (_("\ | 265 | printf (" %s\n", _("[keep timeout than the plugin timeout to retain CRITICAL status]")); |
| 252 | [keep timeout than the plugin timeout to retain CRITICAL status]\n")); | 266 | printf ("\n"); |
| 253 | 267 | printf ("%s\n", _("Examples:")); | |
| 254 | printf (_("\ | 268 | printf (" %s\n", "negate \"/usr/local/nagios/libexec/check_ping -H host\""); |
| 255 | negate \"/usr/local/nagios/libexec/check_ping -H host\"\n\ | 269 | printf (" %s\n", _("Run check_ping and invert result. Must use full path to plugin")); |
| 256 | Run check_ping and invert result. Must use full path to plugin\n\ | 270 | printf (" %s\n", "negate \"/usr/local/nagios/libexec/check_procs -a 'vi negate.c'\""); |
| 257 | negate \"/usr/local/nagios/libexec/check_procs -a 'vi negate.c'\"\n\ | 271 | printf (" %s\n", _("Use single quotes if you need to retain spaces")); |
| 258 | Use single quotes if you need to retain spaces\n")); | 272 | printf (_(UT_VERBOSE)); |
| 259 | 273 | printf ("\n"); | |
| 260 | printf (_("\ | 274 | printf ("%s\n", _("Notes:")); |
| 261 | This plugin is a wrapper to take the output of another plugin and invert it.\n\ | 275 | printf ("%s\n", _("This plugin is a wrapper to take the output of another plugin and invert it.")); |
| 262 | If the wrapped plugin returns STATE_OK, the wrapper will return STATE_CRITICAL.\n\ | 276 | printf ("%s\n", _("If the wrapped plugin returns STATE_OK, the wrapper will return STATE_CRITICAL.")); |
| 263 | If the wrapped plugin returns STATE_CRITICAL, the wrapper will return STATE_OK.\n\ | 277 | printf ("%s\n", _("If the wrapped plugin returns STATE_CRITICAL, the wrapper will return STATE_OK.")); |
| 264 | Otherwise, the output state of the wrapped plugin is unchanged.\n")); | 278 | printf ("%s\n", _("Otherwise, the output state of the wrapped plugin is unchanged.")); |
| 265 | 279 | ||
| 266 | printf (_(UT_SUPPORT)); | 280 | printf (_(UT_SUPPORT)); |
| 267 | } | 281 | } |
| @@ -271,5 +285,6 @@ Otherwise, the output state of the wrapped plugin is unchanged.\n")); | |||
| 271 | void | 285 | void |
| 272 | print_usage (void) | 286 | print_usage (void) |
| 273 | { | 287 | { |
| 274 | printf ("Usage: %s [-t timeout] <definition of wrapped plugin>\n",progname); | 288 | printf (_("Usage:")); |
| 289 | printf ("%s [-t timeout] <definition of wrapped plugin>\n",progname); | ||
| 275 | } | 290 | } |
