X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_swap.c;h=a1356cfac3e5030971cc54b63af43ffadb6aeca5;hb=25d1ee331dbe4977a4a1a756c67f32bd51d9b070;hp=c8b143c50b48103c6022e0a3457332524e7bf082;hpb=6c4468a728788676621d4c5948ae018fc9d7c917;p=nagiosplug.git diff --git a/plugins/check_swap.c b/plugins/check_swap.c index c8b143c..a1356cf 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -6,8 +6,6 @@ * Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net) * Copyright (c) 2000-2007 Nagios Plugins Development Team * -* Last Modified: $Date$ -* * Description: * * This file contains the check_disk plugin @@ -26,12 +24,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * -* $Id$ * *****************************************************************************/ const char *progname = "check_swap"; -const char *revision = "$Revision$"; const char *copyright = "2000-2007"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; @@ -107,6 +103,9 @@ main (int argc, char **argv) status = strdup (""); + /* Parse extra opts if any */ + argv=np_extra_opts (&argc, argv, progname); + if (process_arguments (argc, argv) == ERROR) usage4 (_("Could not parse arguments")); @@ -460,7 +459,7 @@ process_arguments (int argc, char **argv) verbose++; break; case 'V': /* version */ - print_revision (progname, revision); + print_revision (progname, NP_VERSION); exit (STATE_OK); case 'h': /* help */ print_help (); @@ -504,7 +503,7 @@ validate_arguments (void) return ERROR; } else if (warn_percent < crit_percent) { - usage4 + usage4 (_("Warning percentage should be more than critical percentage")); } else if (warn_size_bytes < crit_size_bytes) { @@ -519,17 +518,18 @@ validate_arguments (void) void print_help (void) { - print_revision (progname, revision); + print_revision (progname, NP_VERSION); printf (_(COPYRIGHT), copyright, email); printf ("%s\n", _("Check swap space on local machine.")); printf ("\n\n"); - + print_usage (); - printf (_(UT_HELP_VRSN)); + printf (UT_HELP_VRSN); + printf (UT_EXTRA_OPTS); printf (" %s\n", "-w, --warning=INTEGER"); printf (" %s\n", _("Exit with WARNING status if less than INTEGER bytes of swap space are free")); @@ -541,12 +541,18 @@ print_help (void) printf (" %s\n", _("Exit with CRITCAL status if less than PERCENT of swap space is free")); printf (" %s\n", "-a, --allswaps"); printf (" %s\n", _("Conduct comparisons for all swap partitions, one by one")); - printf (_(UT_VERBOSE)); + printf (UT_VERBOSE); + printf ("\n"); printf ("%s\n", _("Notes:")); - printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.\n")); + printf (" %s\n", _("On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.")); +#ifdef NP_EXTRA_OPTS + printf ("\n"); + printf (UT_EXTRA_OPTS_NOTES); +#endif + - printf (_(UT_SUPPORT)); + printf (UT_SUPPORT); }