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

Commit a551863

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ main() {
9090

9191
# Check for SQL thread errors
9292
LAST_SLAVE_ERRNO=$(awk '/Last_SQL_Errno/{print $2}' "${TEMP_SLAVEDATA}")
93-
93+
94+
# Prevent Negative value due to NTP
95+
# Keep the highest value between 0 and level
96+
LEVEL=$([ "$LEVEL" -gt "0" ] && echo $LEVEL || echo 0)
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)