On Tue, 13 Feb 2024 at 10:57, Brian Scott <bscott at bunyatech.com.au> wrote:
I think Xymon only cares about the success of the command (i.e. is the ntp* server running). ntpdig and ntpdate produce quite different output (I don't have a copy of chronyd around to check). All Xymon does is run the command and displays the output; no parsing is needed. This simply answers the question "Is an ntp service running?" and shouldn't be regarded as proper test of the ntp service ("Is it providing sane answers?", "Is it synced to a reasonable stratum level?", "Is it stable?", ...). Time offset (the only thing reliably given by the various commands) is better handled (but less accurately) by the normal Xymon process reading the client data since that doesn't require the client to be an ntp server.
That's a good point. At first glance at the code, the contrary seems to be the case. The parser specifically looks for the string "no server suitable for synchronization" in the output of the $NTPDATE command, and it sets a result variable based on this. However, almost the very next line of code executed resets this result variable to zero (and hence discards the result of the string match), and then sets the variable based on the return code of the $NTPDATE command. So any command will work as long as the return code depends on a good response from the NTP server.
Cheers Jeremy