diff options
Diffstat (limited to 'plugins/negate.c')
| -rw-r--r-- | plugins/negate.c | 115 |
1 files changed, 20 insertions, 95 deletions
diff --git a/plugins/negate.c b/plugins/negate.c index 7bfef95a..eccc404d 100644 --- a/plugins/negate.c +++ b/plugins/negate.c | |||
| @@ -1,72 +1,36 @@ | |||
| 1 | /****************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Nagios negate plugin | 3 | * Nagios negate plugin |
| 4 | * | 4 | * |
| 5 | * License: GPL | 5 | * License: GPL |
| 6 | * Copyright (c) 2002-2007 nagios-plugins team | 6 | * Copyright (c) 2002-2007 Nagios Plugins Development Team |
| 7 | * | 7 | * |
| 8 | * Last Modified: $Date$ | 8 | * Last Modified: $Date$ |
| 9 | * | 9 | * |
| 10 | * Description: | 10 | * Description: |
| 11 | * | 11 | * |
| 12 | * This file contains the negate plugin | 12 | * This file contains the negate plugin |
| 13 | * | 13 | * |
| 14 | * Negates the status of a plugin (returns OK for CRITICAL, and vice-versa) | 14 | * Negates the status of a plugin (returns OK for CRITICAL, and vice-versa). |
| 15 | * | 15 | * Can also perform custom state switching. |
| 16 | * License Information: | 16 | * |
| 17 | * | 17 | * |
| 18 | * This program is free software; you can redistribute it and/or modify | 18 | * This program is free software: you can redistribute it and/or modify |
| 19 | * it under the terms of the GNU General Public License as published by | 19 | * it under the terms of the GNU General Public License as published by |
| 20 | * the Free Software Foundation; either version 2 of the License, or | 20 | * the Free Software Foundation, either version 3 of the License, or |
| 21 | * (at your option) any later version. | 21 | * (at your option) any later version. |
| 22 | * | 22 | * |
| 23 | * This program is distributed in the hope that it will be useful, | 23 | * This program is distributed in the hope that it will be useful, |
| 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 26 | * GNU General Public License for more details. | 26 | * GNU General Public License for more details. |
| 27 | * | 27 | * |
| 28 | * You should have received a copy of the GNU General Public License | 28 | * You should have received a copy of the GNU General Public License |
| 29 | * along with this program; if not, write to the Free Software | 29 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 30 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 30 | * |
| 31 | * | ||
| 32 | * $Id$ | 31 | * $Id$ |
| 33 | 32 | * | |
| 34 | @@-<article> | 33 | *****************************************************************************/ |
| 35 | |||
| 36 | <sect1> | ||
| 37 | <title>Quick Reference</title> | ||
| 38 | <refentry> | ||
| 39 | <refmeta><manvolnum>5<manvolnum></refmeta> | ||
| 40 | <refnamdiv> | ||
| 41 | <refname>&progname;</refname> | ||
| 42 | <refpurpose>&SUMMARY;</refpurpose> | ||
| 43 | </refnamdiv> | ||
| 44 | </refentry> | ||
| 45 | </sect1> | ||
| 46 | |||
| 47 | <sect1> | ||
| 48 | <title>FAQ</title> | ||
| 49 | </sect1> | ||
| 50 | |||
| 51 | <sect1> | ||
| 52 | <title>Theory, Installation, and Operation</title> | ||
| 53 | |||
| 54 | <sect2> | ||
| 55 | <title>General Description</title> | ||
| 56 | <para> | ||
| 57 | &DESCRIPTION; | ||
| 58 | </para> | ||
| 59 | </sect2> | ||
| 60 | |||
| 61 | <sect2> | ||
| 62 | <title>Future Enhancements</title> | ||
| 63 | <para>ToDo List</para> | ||
| 64 | <itemizedlist> | ||
| 65 | <listitem>Add option to do regex substitution in output text</listitem> | ||
| 66 | </itemizedlist> | ||
| 67 | </sect2>-@@ | ||
| 68 | |||
| 69 | ******************************************************************************/ | ||
| 70 | 34 | ||
| 71 | const char *progname = "negate"; | 35 | const char *progname = "negate"; |
| 72 | const char *revision = "$Revision$"; | 36 | const char *revision = "$Revision$"; |
| @@ -142,25 +106,6 @@ main (int argc, char **argv) | |||
| 142 | } | 106 | } |
| 143 | } | 107 | } |
| 144 | 108 | ||
| 145 | /****************************************************************************** | ||
| 146 | @@- | ||
| 147 | <sect2> | ||
| 148 | <title>Functions</title> | ||
| 149 | |||
| 150 | <sect3> | ||
| 151 | <title>process_arguments</title> | ||
| 152 | |||
| 153 | <para>This function parses the command line into the needed | ||
| 154 | variables.</para> | ||
| 155 | |||
| 156 | <para>Aside from the standard 'help' and 'version' options, there | ||
| 157 | is a only a 'timeout' option.</para> | ||
| 158 | |||
| 159 | </sect3> | ||
| 160 | -@@ | ||
| 161 | ******************************************************************************/ | ||
| 162 | |||
| 163 | |||
| 164 | 109 | ||
| 165 | /* process command-line arguments */ | 110 | /* process command-line arguments */ |
| 166 | static const char ** | 111 | static const char ** |
| @@ -239,19 +184,6 @@ process_arguments (int argc, char **argv) | |||
| 239 | } | 184 | } |
| 240 | 185 | ||
| 241 | 186 | ||
| 242 | /****************************************************************************** | ||
| 243 | @@- | ||
| 244 | <sect3> | ||
| 245 | <title>validate_arguments</title> | ||
| 246 | |||
| 247 | <para>No validation is currently done.</para> | ||
| 248 | |||
| 249 | </sect3> | ||
| 250 | -@@ | ||
| 251 | ******************************************************************************/ | ||
| 252 | |||
| 253 | |||
| 254 | |||
| 255 | int | 187 | int |
| 256 | validate_arguments (char **command_line) | 188 | validate_arguments (char **command_line) |
| 257 | { | 189 | { |
| @@ -262,13 +194,6 @@ validate_arguments (char **command_line) | |||
| 262 | usage4 (_("Require path to command")); | 194 | usage4 (_("Require path to command")); |
| 263 | } | 195 | } |
| 264 | 196 | ||
| 265 | /****************************************************************************** | ||
| 266 | @@- | ||
| 267 | </sect2> | ||
| 268 | </sect1> | ||
| 269 | </article> | ||
| 270 | -@@ | ||
| 271 | ******************************************************************************/ | ||
| 272 | 197 | ||
| 273 | int | 198 | int |
| 274 | translate_state (char *state_text) | 199 | translate_state (char *state_text) |
