From: Benoit Mortier Date: Tue, 20 Jun 2006 11:17:03 +0000 (+0000) Subject: cleaning help and usage + license X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f2d66913f9451674bb7b6dec514cf2fdff9698bc;p=nagiosplug.git cleaning help and usage + license git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1435 f882894a-f735-0410-b71e-b25c423dba1c --- diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 030ef02..f6438f2 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -1,21 +1,34 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - +* +* Nagios check_procs plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_procs plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* $Id$ +* ******************************************************************************/ const char *progname = "check_procs"; diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 07ee4c7..8ee6dd4 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c @@ -1,26 +1,39 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - - ******************************************************************************/ +* +* Nagios check_radius plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_radius plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* $Id$ +* +*******************************************************************************/ const char *progname = "check_radius"; const char *revision = "$Revision$"; -const char *copyright = "2000-2003"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -285,7 +298,9 @@ print_help (void) printf ("Copyright (c) 1999 Robert August Vincent II\n"); printf (COPYRIGHT, copyright, email); - printf(_("Tests to see if a radius server is accepting connections.\n\n")); + printf("%s\n", _("Tests to see if a radius server is accepting connections.")); + + printf ("\n\n"); print_usage (); @@ -293,36 +308,31 @@ print_help (void) printf (_(UT_HOST_PORT), 'P', myport); - printf (_("\ - -u, --username=STRING\n\ - The user to authenticate\n\ - -p, --password=STRING\n\ - Password for autentication (SECURITY RISK)\n\ - -n, --nas-id=STRING\n\ - NAS identifier\n\ - -F, --filename=STRING\n\ - Configuration file\n\ - -e, --expect=STRING\n\ - Response string to expect from the server\n\ - -r, --retries=INTEGER\n\ - Number of times to retry a failed connection\n")); + printf (" %s\n", "-u, --username=STRING"); + printf (" %s\n", _("The user to authenticate")); + printf (" %s\n", "-p, --password=STRING"); + printf (" %s\n", _("Password for autentication (SECURITY RISK)")); + printf (" %s\n", "-n, --nas-id=STRING"); + printf (" %s\n", _("NAS identifier")); + printf (" %s\n", "-F, --filename=STRING"); + printf (" %s\n", _("Configuration file")); + printf (" %s\n", "-e, --expect=STRING"); + printf (" %s\n", _("Response string to expect from the server")); + printf (" %s\n", "-r, --retries=INTEGER"); + printf (" %s\n", _("Number of times to retry a failed connection")); printf (_(UT_TIMEOUT), timeout_interval); - printf (_("\n\ -This plugin tests a radius server to see if it is accepting connections.\n\ -\n\ -The server to test must be specified in the invocation, as well as a user\n\ -name and password. A configuration file may also be present. The format of\n\ -the configuration file is described in the radiusclient library sources.\n\n")); - - printf (_("\ -The password option presents a substantial security issue because the\n\ -password can be determined by careful watching of the command line in\n\ -a process listing. This risk is exacerbated because nagios will\n\ -run the plugin at regular prdictable intervals. Please be sure that\n\ -the password used does not allow access to sensitive system resources,\n\ -otherwise compormise could occur.\n")); + printf ("%s\n", _("This plugin tests a radius server to see if it is accepting connections.")); + printf ("%s\n", _("The server to test must be specified in the invocation, as well as a user")); + printf ("%s\n", _("name and password. A configuration file may also be present. The format of")); + printf ("%s\n", _("the configuration file is described in the radiusclient library sources.")); + printf ("%s\n", _("The password option presents a substantial security issue because the")); + printf ("%s\n", _("password can be determined by careful watching of the command line in")); + printf ("%s\n", _("a process listing. This risk is exacerbated because nagios will")); + printf ("%s\n", _("run the plugin at regular prdictable intervals. Please be sure that")); + printf ("%s\n", _("the password used does not allow access to sensitive system resources,")); + printf ("%s\n", _("otherwise compormise could occur.")); printf (_(UT_SUPPORT)); } @@ -332,7 +342,7 @@ otherwise compormise could occur.\n")); void print_usage (void) { - printf ("\ -Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\ + printf (_("Usage:")); + printf ("%s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\ [-t timeout] [-r retries] [-e expect]\n", progname); } diff --git a/plugins/check_real.c b/plugins/check_real.c index eb892c7..7922bfa 100644 --- a/plugins/check_real.c +++ b/plugins/check_real.c @@ -1,26 +1,40 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - +* +* Nagios check_real plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_real plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* +* $Id$ +* ******************************************************************************/ const char *progname = "check_real"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -103,7 +117,7 @@ main (int argc, char **argv) /* make sure we find the response we are looking for */ if (!strstr (buffer, server_expect)) { if (server_port == PORT) - printf (_("Invalid REAL response received from host\n")); + printf ("%s\n", _("Invalid REAL response received from host")); else printf (_("Invalid REAL response received from host on port %d\n"), server_port); @@ -176,7 +190,7 @@ main (int argc, char **argv) /* make sure we find the response we are looking for */ if (!strstr (buffer, server_expect)) { if (server_port == PORT) - printf (_("Invalid REAL response received from host\n")); + printf ("%s\n", _("Invalid REAL response received from host")); else printf (_("Invalid REAL response received from host on port %d\n"), server_port); @@ -398,7 +412,9 @@ print_help (void) printf ("Copyright (c) 1999 Pedro Leite \n"); printf (COPYRIGHT, copyright, email); - printf (_("This plugin tests the REAL service on the specified host.\n\n")); + printf ("%s\n", _("This plugin tests the REAL service on the specified host.")); + + printf ("\n\n"); print_usage (); @@ -406,11 +422,10 @@ print_help (void) printf (_(UT_HOST_PORT), 'p', myport); - printf (_("\ - -u, --url=STRING\n\ - Connect to this url\n\ - -e, --expect=STRING\n\ - String to expect in first line of server response (default: %s)\n"), + printf (" %s\n", "-u, --url=STRING"); + printf (" %s\n", _("Connect to this url")); + printf (" %s\n", "-e, --expect=STRING"); + printf (_("String to expect in first line of server response (default: %s)\n"), EXPECT); printf (_(UT_WARN_CRIT)); @@ -419,12 +434,11 @@ print_help (void) printf (_(UT_VERBOSE)); - printf(_("\ -This plugin will attempt to open an RTSP connection with the host.\n\ -Successul connects return STATE_OK, refusals and timeouts return\n\ -STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,\n\ -but incorrect reponse messages from the host result in STATE_WARNING return\n\ -values.")); + printf ("%s\n", _("This plugin will attempt to open an RTSP connection with the host.")); + printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return")); + printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,")); + printf ("%s\n", _("but incorrect reponse messages from the host result in STATE_WARNING return")); + printf ("%s\n", _("values.")); printf (_(UT_SUPPORT)); } @@ -434,7 +448,6 @@ values.")); void print_usage (void) { - printf ("\ -Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\ - [-t timeout] [-v]\n", progname); + printf (_("Usage:")); + printf ("%s -H host [-e expect] [-p port] [-w warn] [-c crit] [-t timeout] [-v]\n", progname); } diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 3dc444f..e7cf2ea 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -1,26 +1,40 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - +* +* Nagios check_smtp plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_smtp plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* +* $Id$ +* ******************************************************************************/ const char *progname = "check_smtp"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -657,6 +671,15 @@ validate_arguments (void) } +int +my_close (void) +{ +#ifdef HAVE_SSL + np_net_ssl_cleanup(); +#endif + return close(sd); +} + void print_help (void) @@ -669,7 +692,9 @@ print_help (void) printf ("Copyright (c) 1999-2001 Ethan Galstad \n"); printf (COPYRIGHT, copyright, email); - printf(_("This plugin will attempt to open an SMTP connection with the host.\n\n")); + printf("%s\n", _("This plugin will attempt to open an SMTP connection with the host.")); + + printf ("\n\n"); print_usage (); @@ -679,34 +704,29 @@ print_help (void) printf (_(UT_IPv46)); - printf (_("\ - -e, --expect=STRING\n\ - String to expect in first line of server response (default: '%s')\n\ - -n, nocommand\n\ - Suppress SMTP command\n\ - -C, --command=STRING\n\ - SMTP command (may be used repeatedly)\n\ - -R, --command=STRING\n\ - Expected response to command (may be used repeatedly)\n\ - -f, --from=STRING\n\ - FROM-address to include in MAIL command, required by Exchange 2000\n"), - SMTP_EXPECT); + printf (" %s\n", "-e, --expect=STRING"); + printf (_("String to expect in first line of server response (default: '%s')"),SMTP_EXPECT); + printf (" %s\n\n", "-n, nocommand\n"); + printf (" %s\n", _("Suppress SMTP command")); + printf (" %s\n", "-C, --command=STRING"); + printf (" %s\n", _("SMTP command (may be used repeatedly)")); + printf (" %s\n", "-R, --command=STRING"); + printf (" %s\n", _("Expected response to command (may be used repeatedly)")); + printf (" %s\n", "-f, --from=STRING"); + printf (" %s\n", _("FROM-address to include in MAIL command, required by Exchange 2000")), #ifdef HAVE_SSL - printf (_("\ - -D, --certificate=INTEGER\n\ - Minimum number of days a certificate has to be valid.\n\ - -S, --starttls\n\ - Use STARTTLS for the connection.\n")); + printf (" %s\n", "-D, --certificate=INTEGER"); + printf (" %s\n", _("Minimum number of days a certificate has to be valid.")); + printf (" %s\n", "-S, --starttls"); + printf (" %s\n", _("Use STARTTLS for the connection.")); #endif - printf("\ - -A, --authtype=STRING\n\ - SMTP AUTH type to check (default none, only LOGIN supported)\n\ - -U, --authuser=STRING\n\ - SMTP AUTH username\n\ - -P, --authpass=STRING\n\ - SMTP AUTH password\n\ - "); + printf (" %s\n", "-A, --authtype=STRING"); + printf (" %s\n", _("SMTP AUTH type to check (default none, only LOGIN supported)")); + printf (" %s\n", "-U, --authuser=STRING"); + printf (" %s\n", _("SMTP AUTH username")); + printf (" %s\n", "-P, --authpass=STRING"); + printf (" %s\n", _("SMTP AUTH password")); printf (_(UT_WARN_CRIT)); @@ -714,11 +734,10 @@ print_help (void) printf (_(UT_VERBOSE)); - printf(_("\n\ -Successul connects return STATE_OK, refusals and timeouts return\n\ -STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful\n\ -connects, but incorrect reponse messages from the host result in\n\ -STATE_WARNING return values.\n")); + printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return")); + printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful")); + printf ("%s\n", _("connects, but incorrect reponse messages from the host result in")); + printf ("%s\n", _("STATE_WARNING return values.")); printf (_(UT_SUPPORT)); } @@ -728,17 +747,9 @@ STATE_WARNING return values.\n")); void print_usage (void) { - printf ("\ -Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ + printf (_("Usage:")); + printf ("%s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ [-A authtype -U authuser -P authpass]\n\ [-w warn] [-c crit] [-t timeout] [-S] [-D days] [-n] [-v] [-4|-6]\n", progname); } -int -my_close (void) -{ -#ifdef HAVE_SSL - np_net_ssl_cleanup(); -#endif - return close(sd); -} diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 9ff3439..e2b4555 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -1,26 +1,39 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - +* +* Nagios check_snmp plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_snmp plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* $Id$ +* ******************************************************************************/ const char *progname = "check_snmp"; const char *revision = "$Revision$"; -const char *copyright = "1999-2004"; +const char *copyright = "1999-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -884,8 +897,9 @@ print_help (void) printf (COPYRIGHT, copyright, email); - printf (_("\ -Check status of remote machines and obtain sustem information via SNMP\n\n")); + printf ("%s\n", _("Check status of remote machines and obtain sustem information via SNMP")); + + printf ("\n\n"); print_usage (); @@ -992,8 +1006,8 @@ Check status of remote machines and obtain sustem information via SNMP\n\n")); void print_usage (void) { - printf ("\ -Usage: %s -H -o [-w warn_range] [-c crit_range] \n\ + printf (_("Usage:")); + printf ("%s -H -o [-w warn_range] [-c crit_range] \n\ [-C community] [-s string] [-r regex] [-R regexi]\n\ [-t timeout] [-e retries]\n\ [-l label] [-u units] [-p port-number] [-d delimiter]\n\ diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 5617add..1a99e24 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -1,26 +1,39 @@ /****************************************************************************** - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ - +* +* Nagios check_ssh plugin +* +* License: GPL +* Copyright (c) 1999-2006 nagios-plugins team +* +* Last Modified: $Date$ +* +* Description: +* +* This file contains the check_ssh plugin +* +* License Information: +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* $Id$ +* ******************************************************************************/ const char *progname = "check_ssh"; const char *revision = "$Revision$"; -const char *copyright = "2000-2004"; +const char *copyright = "2000-2006"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -258,7 +271,9 @@ print_help (void) printf ("Copyright (c) 1999 Remi Paulmier \n"); printf (COPYRIGHT, copyright, email); - printf (_("Try to connect to an SSH server at specified server and port\n\n")); + printf ("%s\n", _("Try to connect to an SSH server at specified server and port")); + + printf ("\n\n"); print_usage (); @@ -270,9 +285,8 @@ print_help (void) printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); - printf (_("\ - -r, --remote-version=STRING\n\ - Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)\n")); + printf (" %s\n" "-r, --remote-version=STRING"); + printf (" %s\n", _("Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)")); printf (_(UT_VERBOSE)); @@ -284,7 +298,7 @@ print_help (void) void print_usage (void) { - printf ("\ -Usage: %s [-46] [-t ] [-r ] [-p ] \n", progname); + printf (_("Usage:")); + printf ("%s [-46] [-t ] [-r ] [-p ] \n", progname); }