diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-03-15 19:54:32 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-03-15 19:54:32 +0000 |
commit | 1c229b2c4572f1fcf5e1fe470f49df49111816f5 (patch) | |
tree | 6167387224b617a43edd091afec075b262113dc2 /plugins/t/check_mysql.t | |
parent | edf94c7d2a21142b0cf9613dbbc1ff7a48f456ef (diff) | |
download | monitoring-plugins-1c229b2c4572f1fcf5e1fe470f49df49111816f5.tar.gz |
Alert on amount of time a slave is behind (Steven Kreuzer)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1324 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t/check_mysql.t')
-rw-r--r-- | plugins/t/check_mysql.t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t index e961106b..78413c6e 100644 --- a/plugins/t/check_mysql.t +++ b/plugins/t/check_mysql.t @@ -19,7 +19,7 @@ use vars qw($tests); 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: { - 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"); } |