From 958dfa35fd030e5b609298b1236692c85b6ffafc Mon Sep 17 00:00:00 2001 From: batsumaru <> Date: Wed, 1 Jul 2026 18:35:27 +0900 Subject: Fix clock offset extraction dropping positive values ntpq's "rv 0 offset" prefixes non-negative offsets with an explicit "+" (e.g. "offset=+0.030208"), which wasn't in the sed capture class ([-0-9.]). Since the capture group is starred, the regex still "matched" with an empty capture instead of failing outright, silently producing "no response" for every positive/zero offset while negative ones (which do use "-", already in the class) worked fine. Confirmed against the real box: earlier renders with negative drift worked, then it started showing "no response" once the drift crossed zero. Co-Authored-By: Claude Sonnet 5 --- statuspage/checks/ntpd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'statuspage/checks/ntpd.sh') diff --git a/statuspage/checks/ntpd.sh b/statuspage/checks/ntpd.sh index 1770dc8..c95807b 100755 --- a/statuspage/checks/ntpd.sh +++ b/statuspage/checks/ntpd.sh @@ -16,7 +16,7 @@ if [ "$NTPD_STATUS" != "ok" ]; then exit 0 fi -RAW=$(ntpq -c "rv 0 offset" 2>/dev/null | sed -n 's/.*offset=\([-0-9.]*\).*/\1/p') +RAW=$(ntpq -c "rv 0 offset" 2>/dev/null | sed -n 's/.*offset=\([-+0-9.]*\).*/\1/p') if [ -z "$RAW" ]; then json_line "host services" "clock offset" "no response" "warn" -- cgit v1.3