Merge lp:~fraserbn/percona-monitoring-plugins/fix-1040528-pmp-mysql-delay-if-seconds-behind-master-is-zero into lp:percona-monitoring-plugins/1.0

Proposed by Brian Fraser
Status: Merged
Merged at revision: 101
Proposed branch: lp:~fraserbn/percona-monitoring-plugins/fix-1040528-pmp-mysql-delay-if-seconds-behind-master-is-zero
Merge into: lp:percona-monitoring-plugins/1.0
Diff against target: 74 lines (+50/-1)
3 files modified
nagios/bin/pmp-check-mysql-replication-delay (+3/-1)
t/nagios/pmp-check-mysql-replication-delay/check-functions.sh (+8/-0)
t/nagios/pmp-check-mysql-replication-delay/samples/show-slave-status-002.txt (+39/-0)
To merge this branch: bzr merge lp:~fraserbn/percona-monitoring-plugins/fix-1040528-pmp-mysql-delay-if-seconds-behind-master-is-zero
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Brian Fraser (community) Approve
Review via email: mp+121031@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Fraser (fraserbn) :
review: Approve
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nagios/bin/pmp-check-mysql-replication-delay'
2--- nagios/bin/pmp-check-mysql-replication-delay 2012-06-11 10:54:55 +0000
3+++ nagios/bin/pmp-check-mysql-replication-delay 2012-08-23 15:44:29 +0000
4@@ -81,7 +81,9 @@
5 # Test whether the delay is too long.
6 if [ "$MYSQL_CONN" = 0 ]; then
7 NOTE="${LEVEL:-0} seconds of replication delay"
8- if [ "${LEVEL:-0}" -gt "${OPT_CRIT}" ]; then
9+ if [ "${LEVEL:-""}" = "NULL" ]; then
10+ NOTE="UNK replica is stopped"
11+ elif [ "${LEVEL:-0}" -gt "${OPT_CRIT}" ]; then
12 NOTE="CRIT $NOTE"
13 elif [ "${LEVEL:-0}" -gt "${OPT_WARN}" ]; then
14 NOTE="WARN $NOTE"
15
16=== modified file 't/nagios/pmp-check-mysql-replication-delay/check-functions.sh'
17--- t/nagios/pmp-check-mysql-replication-delay/check-functions.sh 2012-02-20 02:50:12 +0000
18+++ t/nagios/pmp-check-mysql-replication-delay/check-functions.sh 2012-08-23 15:44:29 +0000
19@@ -10,3 +10,11 @@
20
21 echo "should print CRIT 10 seconds of replication delay"
22 main -c 9 samples/show-slave-status-001.txt
23+
24+echo "should print UNK if the slave is not running"
25+out=`main samples/show-slave-status-002.txt`
26+if [ "${out:-""}" = "UNK replica is stopped" ]; then
27+ echo "ok"
28+else
29+ echo "not ok"
30+fi
31
32=== added file 't/nagios/pmp-check-mysql-replication-delay/samples/show-slave-status-002.txt'
33--- t/nagios/pmp-check-mysql-replication-delay/samples/show-slave-status-002.txt 1970-01-01 00:00:00 +0000
34+++ t/nagios/pmp-check-mysql-replication-delay/samples/show-slave-status-002.txt 2012-08-23 15:44:29 +0000
35@@ -0,0 +1,39 @@
36+*************************** 1. row ***************************
37+ Slave_IO_State: Waiting for master to send event
38+ Master_Host: master.db
39+ Master_User: replication
40+ Master_Port: 3306
41+ Connect_Retry: 60
42+ Master_Log_File: mysql-bin.000545
43+ Read_Master_Log_Pos: 521709851
44+ Relay_Log_File: mysql-relay.001273
45+ Relay_Log_Pos: 4871334
46+ Relay_Master_Log_File: mysql-bin.000545
47+ Slave_IO_Running: Yes
48+ Slave_SQL_Running: Yes
49+ Replicate_Do_DB:
50+ Replicate_Ignore_DB:
51+ Replicate_Do_Table:
52+ Replicate_Ignore_Table:
53+ Replicate_Wild_Do_Table:
54+ Replicate_Wild_Ignore_Table:
55+ Last_Errno: 0
56+ Last_Error:
57+ Skip_Counter: 0
58+ Exec_Master_Log_Pos: 521709851
59+ Relay_Log_Space: 4871528
60+ Until_Condition: None
61+ Until_Log_File:
62+ Until_Log_Pos: 0
63+ Master_SSL_Allowed: Yes
64+ Master_SSL_CA_File: /mnt/data-store/mysql/ca-cert.pem
65+ Master_SSL_CA_Path:
66+ Master_SSL_Cert: /mnt/data-store/mysql/client-cert.pem
67+ Master_SSL_Cipher:
68+ Master_SSL_Key: /mnt/data-store/mysql/client-key.pem
69+ Seconds_Behind_Master: NULL
70+Master_SSL_Verify_Server_Cert: No
71+ Last_IO_Errno: 0
72+ Last_IO_Error:
73+ Last_SQL_Errno: 0
74+ Last_SQL_Error:

Subscribers

People subscribed via source and target branches