[monitoring-plugins] Clarify check_mysql test prompts

Git Repository git at monitoring-plugins.org
Tue Jan 28 08:40:07 CET 2014


 Module: monitoring-plugins
 Branch: master
 Commit: c30be5877cf0756dbdc361f7049483bf737f9403
 Author: Thomas Guyot-Sionnest <dermoth at aei.ca>
   Date: Tue Jan 28 02:35:09 2014 -0500
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=c30be58

Clarify check_mysql test prompts

Also default to "-u test -ptest" which are default MySQL accounts only
missing the prescribed privileges.

The database is no longer specified as it is not used.
If wanted is should be its own parameter/tests.

---

 plugins/t/check_mysql.t | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t
index d971645..28cd4cd 100644
--- a/plugins/t/check_mysql.t
+++ b/plugins/t/check_mysql.t
@@ -21,27 +21,29 @@ plan skip_all => "check_mysql not compiled" unless (-x "check_mysql");
 plan tests => 15;
 
 my $bad_login_output = '/Access denied for user /';
-my $mysqlserver = getTestParameter( 
-		"NP_MYSQL_SERVER", 
+my $mysqlserver = getTestParameter(
+		"NP_MYSQL_SERVER",
 		"A MySQL Server hostname or IP with no slaves setup"
 		);
-my $mysqlsocket = getTestParameter( 
-		"NP_MYSQL_SOCKET", 
-		"A MySQL Server socket with no slaves setup"
+my $mysqlsocket = getTestParameter(
+		"NP_MYSQL_SOCKET",
+		"Full path to a MySQL Server socket with no slaves setup"
 		);
-my $mysql_login_details = getTestParameter( 
-		"MYSQL_LOGIN_DETAILS", 
-		"Command line parameters to specify login access",
-		"-u user -ppw -d db",
+my $mysql_login_details = getTestParameter(
+		"MYSQL_LOGIN_DETAILS",
+		"Command line parameters to specify login access (requires " .
+		"REPLICATION CLIENT privleges)",
+		"-u test -ptest",
 		);
-my $with_slave = getTestParameter( 
-		"NP_MYSQL_WITH_SLAVE", 
+my $with_slave = getTestParameter(
+		"NP_MYSQL_WITH_SLAVE",
 		"MySQL server with slaves setup"
 		);
-my $with_slave_login = getTestParameter( 
-		"NP_MYSQL_WITH_SLAVE_LOGIN", 
-		"Login details for server with slave", 
-		"-uroot -ppw"
+my $with_slave_login = getTestParameter(
+		"NP_MYSQL_WITH_SLAVE_LOGIN",
+		"Login details for server with slave (requires REPLICATION CLIENT " .
+		"privleges)",
+		$mysql_login_details || "-u test -ptest"
 		);
 
 my $result;



More information about the Commits mailing list