Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Commit 5c54eea

Browse files
committed
Prevent negative lag in pmp-check-mysql-replication-delay
1 parent ca16cdc commit 5c54eea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nagios/bin/pmp-check-mysql-replication-delay

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ main() {
9191
# Check for SQL thread errors
9292
LAST_SLAVE_ERRNO=$(awk '/Last_SQL_Errno/{print $2}' "${TEMP_SLAVEDATA}")
9393

94+
# Prevent Negative value due to NTP
95+
# Keep the highest value between 0 and level
96+
LEVEL=$([ "$LEVEL:-0" -le "0" ] && echo 0 || echo $LEVEL)
9497
# Build the common perf data output for graph trending
9598
PERFDATA="replication_delay=${LEVEL:-0};${OPT_WARN};${OPT_CRIT};0;"
9699

0 commit comments

Comments
 (0)