Code

Bump plugins/ to GPLv3 (check_apt to check_nwstat)
[nagiosplug.git] / plugins / check_mysql.c
index 573ec96a8a4aecd6b266063f389cf0ba57f2fa39..ad15a77c96c47824a6883e2490a23fd13c90fb24 100644 (file)
@@ -1,44 +1,41 @@
-/******************************************************************************
-*
+/*****************************************************************************
+* 
 * 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
@@ -318,18 +315,18 @@ process_arguments (int argc, char **argv)
 
        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++]);
@@ -391,7 +388,7 @@ print_help (void)
   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"));