index 171fc69fab3e8eeeeec60d8c3e345fbdf7be035c..47dd86163daee69a0381b0f4e2d92c238713935a 100644 (file)
* 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";
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ /* Parse extra opts if any */
+ argv=np_extra_opts (&argc, argv, progname);
+
if (process_arguments (argc, argv) == ERROR)
usage4 (_("Could not parse arguments"));
return ERROR;
while (1) {
- c = getopt_long (argc, argv, "hvVSP:p:u:d:H:s:q:w:c:", longopts, &option);
+ c = getopt_long (argc, argv, "hvVP:p:u:d:H:s:q:w:c:", longopts, &option);
if (c == -1 || c == EOF)
break;
verbose++;
break;
case 'V': /* version */
- print_revision (progname, revision);
+ print_revision (progname, NP_VERSION);
exit (STATE_OK);
case 'h': /* help */
print_help ();
if (db_host == NULL)
db_host = strdup("");
- if (db_pass == NULL)
- db_pass == strdup("");
-
if (db == NULL)
db = strdup("");
char *myport;
asprintf (&myport, "%d", MYSQL_PORT);
- print_revision (progname, revision);
+ print_revision (progname, NP_VERSION);
printf (_(COPYRIGHT), copyright, email);
print_usage ();
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 (" %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));
+ printf ("\n");
+ printf (" %s\n", _("You must specify -p with an empty string to force an empty password,"));
+ printf (" %s\n", _("overriding any my.cnf settings."));
+#endif
+
printf (_(UT_SUPPORT));
}