diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 573ec96a8a4aecd6b266063f389cf0ba57f2fa39..ad15a77c96c47824a6883e2490a23fd13c90fb24 100644 (file)
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
-/******************************************************************************
-*
+/*****************************************************************************
+*
* Nagios check_mysql plugin
-*
+*
* License: GPL
-* Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)
-* Copyright (c) 1999-2006 nagios-plugins team
-* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
-*
+* Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)
+* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
+* Copyright (c) 1999-2007 Nagios Plugins Development Team
+*
* Last Modified: $Date$
*
* Description:
-*
+*
* This file contains the check_mysql plugin
-*
-* This program tests connections to a mysql server
-*
-*
-* License Information:
-*
-* This program is free software; you can redistribute it and/or modify
+*
+* This program tests connections to a mysql server
+*
+*
+* 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
+* the Free Software Foundation, either version 3 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.
-*
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
* $Id$
-*
-******************************************************************************/
+*
+*****************************************************************************/
const char *progname = "check_mysql";
const char *revision = "$Revision$";
-const char *copyright = "1999-2006";
+const char *copyright = "1999-2007";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#define SLAVERESULTSIZE 70
while ( argc > c ) {
- if (strlen(db_host) == 0)
+ if (db_host == NULL)
if (is_host (argv[c])) {
db_host = argv[c++];
}
else {
- usage2 (_("Invalid hostname/address"), optarg);
+ usage2 (_("Invalid hostname/address"), argv[c]);
}
- else if (strlen(db_user) == 0)
+ else if (db_user == NULL)
db_user = argv[c++];
- else if (strlen(db_pass) == 0)
+ else if (db_pass == NULL)
db_pass = argv[c++];
- else if (strlen(db) == 0)
+ else if (db == NULL)
db = argv[c++];
else if (is_intnonneg (argv[c]))
db_port = atoi (argv[c++]);
printf (" %s\n", "-S, --check-slave");
printf (" %s\n", _("Check if the slave thread is running properly."));
printf (" %s\n", "-w, --warning");
- printf (" %s\n", _("Exit with WARNING status if slave server is more then INTEGER seconds behind master"));
+ printf (" %s\n", _("Exit with WARNING status if slave server is more than INTEGER seconds behind master"));
printf (" %s\n", "-c, --critical");
printf (" %s\n", _("Exit with CRITICAL status if slave server is more then INTEGER seconds behind master"));
printf (" %s\n", _("There are no required arguments. By default, the local database with"));