Code

tools/distclean: use git-clean when possible
[nagiosplug.git] / plugins / check_mysql_query.c
index a92b85701a56fc879c0ad3b76907ce77c8f43d6d..cf9d8dfb2db227cd96e5f1eb50c2d86d7f87d8ef 100644 (file)
@@ -3,11 +3,9 @@
 * Nagios check_mysql_query plugin
 * 
 * License: GPL
-* Copyright (c) 2006-2007 Nagios Plugins Development Team
+* Copyright (c) 2006-2009 Nagios Plugins Development Team
 * Original code from check_mysql, copyright 1999 Didi Rieder
 * 
-* Last Modified: $Date$
-* 
 * Description:
 * 
 * This file contains the check_mysql_query plugin
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
-* $Id$
 * 
 *****************************************************************************/
 
 const char *progname = "check_mysql_query";
-const char *revision = "$Revision$";
 const char *copyright = "1999-2007";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
@@ -231,7 +227,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 ();
@@ -270,9 +266,6 @@ validate_arguments (void)
        if (db_host == NULL)
                db_host = strdup("");
 
-       if (db_pass == NULL)
-               db_pass = strdup("");
-
        if (db == NULL)
                db = strdup("");
 
@@ -286,7 +279,7 @@ print_help (void)
        char *myport;
        asprintf (&myport, "%d", MYSQL_PORT);
 
-       print_revision (progname, revision);
+       print_revision (progname, NP_VERSION);
 
        printf (_(COPYRIGHT), copyright, email);
 
@@ -296,12 +289,12 @@ print_help (void)
 
        print_usage ();
 
-       printf (_(UT_HELP_VRSN));
-       printf (_(UT_EXTRA_OPTS));
+       printf (UT_HELP_VRSN);
+       printf (UT_EXTRA_OPTS);
        printf (" -q, --query=STRING\n");
        printf ("    %s\n", _("SQL query to run. Only first column in first row will be read"));
-       printf (_(UT_WARN_CRIT_RANGE));
-       printf (_(UT_HOST_PORT), 'P', myport);
+       printf (UT_WARN_CRIT_RANGE);
+       printf (UT_HOST_PORT, 'P', myport);
        printf (" %s\n", "-s, --socket=STRING");
        printf ("    %s\n", _("Use the specified socket (has no effect if -H is used)"));
        printf (" -d, --database=STRING\n");
@@ -317,20 +310,19 @@ print_help (void)
        printf (" %s\n", _("A query is required. The result from the query should be numeric."));
        printf (" %s\n", _("For extra security, create a user with minimal access."));
 
-#ifdef NP_EXTRA_OPTS
        printf ("\n");
        printf ("%s\n", _("Notes:"));
-       printf (_(UT_EXTRA_OPTS_NOTES));
-#endif
+       printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
+       printf (" %s\n", _("overriding any my.cnf settings."));
 
-       printf (_(UT_SUPPORT));
+       printf (UT_SUPPORT);
 }
 
 
 void
 print_usage (void)
 {
-  printf (_("Usage:"));
+  printf ("%s\n", _("Usage:"));
   printf (" %s -q SQL_query [-w warn] [-c crit] [-H host] [-P port] [-s socket]\n",progname);
   printf ("       [-d database] [-u user] [-p password]\n");
 }