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); | |||
19 | 19 | ||
20 | plan skip_all => "check_mysql not compiled" unless (-x "check_mysql"); | 20 | plan skip_all => "check_mysql not compiled" unless (-x "check_mysql"); |
21 | 21 | ||
22 | plan tests => 7; | 22 | plan tests => 10; |
23 | 23 | ||
24 | my $bad_login_output = '/Access denied for user /'; | 24 | my $bad_login_output = '/Access denied for user /'; |
25 | my $mysqlserver = getTestParameter( | 25 | my $mysqlserver = getTestParameter( |
@@ -58,10 +58,17 @@ SKIP: { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | SKIP: { | 60 | SKIP: { |
61 | skip "No mysql server with slaves defined", 2 unless $with_slave; | 61 | skip "No mysql server with slaves defined", 5 unless $with_slave; |
62 | $result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login"); | 62 | $result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login"); |
63 | cmp_ok( $result->return_code, '==', 0, "Login okay"); | 63 | cmp_ok( $result->return_code, '==', 0, "Login okay"); |
64 | 64 | ||
65 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login"); | 65 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login"); |
66 | cmp_ok( $result->return_code, "==", 0, "Slaves okay" ); | 66 | cmp_ok( $result->return_code, "==", 0, "Slaves okay" ); |
67 | |||
68 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60"); | ||
69 | cmp_ok( $result->return_code, '==', 0, 'Slaves are not > 60 seconds behind'); | ||
70 | |||
71 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60:"); | ||
72 | cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind'); | ||
73 | like( $result->output, "/^SLOW_SLAVE WARNING:/", "Output okay"); | ||
67 | } | 74 | } |