Give pt-heartbeat an option to make it check slave lag and exit 0 or 1

Registered by Daniel Nichter

From bug 1133251:

pt-heartbeat is a great tool. We use it alongside monit to generate alerts if any of our slaves fall behind. However, that requires an intermediary script. It would be great if pt-heartbeat had an option whereby it would check that the replication delay is within a certain threshold and if so, exit 0, if not, exit 1. That would allow other scripts (such as monit) to call pt-heartbeat at regular intervals and verify the replication delay.

I imagine a single argument could be added along the lines of:
--check-threshold 60

Where 60 is the number of seconds considered acceptable. Anything over that would result in a non zero exit code.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.