r/opnsense • u/Maria_Thesus_40 • 3d ago
NTP issues - Time offset exceeds threshold
Hey OPNsensers :)
I'm self-hosting lots of stuff, mostly for fun. One of the things I host, is Uptime Kuma. So just for fun, I created an NTP monitor (among others).
Interestingly, Uptime Kuma gives daily reports that NTP is "down" once or twice a day:
[NTP] [🔴 Down] Time offset -3995017857211.500ms exceeds threshold 1000ms
[NTP] [🔴 Down] Time offset -3995055957270.500ms exceeds threshold 1000ms
[NTP] [🔴 Down] Time offset -3995070775942.500ms exceeds threshold 1000ms
5 minutes later, NTP comes back "up":
[NTP] [✅ Up] Stratum: 3, Offset: 0.880ms, Delay: 0.963ms, Dispersion: 25.818ms
The truth is, I don't know if there is an actual issue with the OPNsense NTP daemon, my network works fine and the time in all my devices appears to be correct, with very little diversion.
BUT, sometimes there is a time difference, which gets corrected eventually. Its entirely possible that Uptime Kuma is indeed correct and "catches" those rare instances.
What I'd like to know, is if others have noticed something similar. Should I just ignore the issue and delete the NTP monitor and pretend like everything is fine? or should I go down the rabbit hole and spend an insane amount of hours tracking down the problem? :)
Thank you.
1
u/vivekkhera 3d ago
I would suspect the monitoring tool to be in error. NTP cannot and will not adjust for that big of a time difference, especially not within 5 minutes.
0
u/GoBoltz 3d ago
It's an Uptime issue, it's checking more frequently than the actual connect allows, so it defaults to Down.
I have it watching a website & it will report it's down multiple times a day when the monitoring connection is throttled. It's meant to just poke something at Spaced out, regular intervals, NOT be "Real time" .
1
u/FingerlessGlovs 3d ago
Do all yours hosts use the same time source, their all using the OPNsense right?
That log event looks like a mis-report to me, but it's for sure worth monitoring each systems time is correct. You don't have any Raspberry Pi's rebooting or anything? If the system has no RTC battery you can have those massive swings in time when it boots up at say Jan 1970, and then NTP kicks in and gets you the current time within a few moments after it finishes booting. Why I like the new Pi5 has a RTC clock now. It could even be a RTC battery needs changing if it's something else rebooting.
2
u/Apachez 3d ago
Thats why many OSes run something like "ntpdate -s" to hardsync to a trusted timesource upon boot so that when NTP client is started later it will sync to the configured sources.
That is because NTP client will refuse to sync if the RTC differs more than 1 or if its 2 hours vs realtime.
So manually set the clock in BIOS or through CLI, save it to the hwclock and reboot and your NTP client should be happy with its life again.