[Pkg-nagios-devel] Bug#447529: nagios-plugins: check_mysql_cmdlinecred command line syntax error

Chris Watt cnww at hfx.andara.com
Sun Oct 21 22:21:15 UTC 2007


Package: nagios-plugins
Version: 1.4.5-1
Severity: important
Tags: patch


mysql.cfg appears to assume that "-H hostname" specifies a host and "-p 
password" specifies a password. In fact "-H" specifes "use HTML output", 
the $HOSTADDRESS$ value is treated as a database name, "-p" specifies 
"prompt me for a password" and $ARG2$ would be another database name if 
it weren't a syntax error to specify two of them.

The correct command line syntax for MySQL 5 (as shipped with Etch) is:
/usr/lib/nagios/plugins/check_mysql -h $HOSTADDRESS$ -u $ARG1$ -p$ARG2$

(which uses $HOSTADDRESS$ as the host, $ARG1$ as the username and $ARG2$ 
as the password).

To make this as simple as possible to fix I have also included a patch 
that corrects the arguments:

--- /tmp/mysql.cfg	2007-10-21 19:08:14.000000000 -0300
+++ mysql.cfg	2007-10-21 19:11:16.000000000 -0300
@@ -7,5 +7,5 @@
 # 'check_mysql_cmdlinecred' command definition
 define command{
 	command_name    check_mysql_cmdlinecred
-	command_line    /usr/lib/nagios/plugins/check_mysql -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
+	command_line    /usr/lib/nagios/plugins/check_mysql -h $HOSTADDRESS$ -u $ARG1$ -p$ARG2$
 }


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-686
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)

Versions of packages nagios-plugins depends on:
ii  nagios-plugins-basic          1.4.5-1    Plugins for the nagios network mon
ii  nagios-plugins-standard       1.4.5-1    Plugins for the nagios network mon

nagios-plugins recommends no packages.

-- no debconf information
-------------- next part --------------
--- /tmp/mysql.cfg	2007-10-21 19:08:14.000000000 -0300
+++ mysql.cfg	2007-10-21 19:11:16.000000000 -0300
@@ -7,5 +7,5 @@
 # 'check_mysql_cmdlinecred' command definition
 define command{
 	command_name    check_mysql_cmdlinecred
-	command_line    /usr/lib/nagios/plugins/check_mysql -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
+	command_line    /usr/lib/nagios/plugins/check_mysql -h $HOSTADDRESS$ -u $ARG1$ -p$ARG2$
 }


More information about the Pkg-nagios-devel mailing list