[Nagiosplug-checkins] nagiosplug/plugins/t check_mysql.t,1.6,1.7
Ton Voon
tonvoon at users.sourceforge.net
Wed Mar 15 11:55:09 CET 2006
Update of /cvsroot/nagiosplug/nagiosplug/plugins/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20130/plugins/t
Modified Files:
check_mysql.t
Log Message:
Alert on amount of time a slave is behind (Steven Kreuzer)
Index: check_mysql.t
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/t/check_mysql.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- check_mysql.t 31 Jan 2006 14:37:11 -0000 1.6
+++ check_mysql.t 15 Mar 2006 19:54:32 -0000 1.7
@@ -19,7 +19,7 @@
plan skip_all => "check_mysql not compiled" unless (-x "check_mysql");
-plan tests => 7;
+plan tests => 10;
my $bad_login_output = '/Access denied for user /';
my $mysqlserver = getTestParameter(
@@ -58,10 +58,17 @@
}
SKIP: {
- skip "No mysql server with slaves defined", 2 unless $with_slave;
+ skip "No mysql server with slaves defined", 5 unless $with_slave;
$result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login");
cmp_ok( $result->return_code, '==', 0, "Login okay");
$result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login");
cmp_ok( $result->return_code, "==", 0, "Slaves okay" );
+
+ $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60");
+ cmp_ok( $result->return_code, '==', 0, 'Slaves are not > 60 seconds behind');
+
+ $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60:");
+ cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind');
+ like( $result->output, "/^SLOW_SLAVE WARNING:/", "Output okay");
}
More information about the Commits
mailing list