From paul at crawford-space.co.uk Mon Jun 8 18:57:29 2026 From: paul at crawford-space.co.uk (Paul Crawford) Date: Mon, 8 Jun 2026 17:57:29 +0100 Subject: Some patches for check_ntp_time Message-ID: <2f57514c-3a66-5aa5-dc87-e000b0335d65@crawford-space.co.uk> Hi, I'm not really a software developer so not completely up to speed with sensing git pull requests, etc, the correct way. I was trying to use the check_ntp_time plug-in with Nagios to check some servers that may, or may not, allow querying (as check_ntp_perr needs) and I found that some simply did not yield a sensible answer with check_ntp_time. It seems the very rapid pooling to get the average time difference of client and host time was causing the server to block after the first one or two responses. So I thought it worth trying to add some delay so they don't block the query and that seems to work (at least in my case) if the delay is around 0.5 seconds. While compiling the code I saw a warning about the use of strncpy() so that is also fixed. It would cause the plugin to segfault if you told it the host was a socket such as /very...very...long...path that was over something like 108 bytes. Attached are the diffs from my local git clone for the strncpy() bug-fix, and for the added polling delay, in case they are of use to improve the code base. Regards, Paul -------------- next part -------------- A non-text attachment was scrubbed... Name: fix-strncpy.diff Type: text/x-patch Size: 981 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: add-poll-delay.diff Type: text/x-patch Size: 4739 bytes Desc: not available URL: