Changed ntp-client script version to static "1"#596
Open
tim427 wants to merge 1 commit intolibrenms:masterfrom
Open
Changed ntp-client script version to static "1"#596tim427 wants to merge 1 commit intolibrenms:masterfrom
tim427 wants to merge 1 commit intolibrenms:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simplify version handling in ntp-client extend script
This pull request corrects and simplifies how the
versionfield is handled in thentp-clientSNMP extend script.Background
The current implementation attempts to determine the NTP protocol version by parsing runtime information. However:
ntpdsoftware version, which is something entirely different.As documented in
includes/polling/functions.inc.php:The
versionfield is intended to represent the version of the SNMP extend script itself (in this case,ntp-client), not:ntpdsoftware version installed on the system.Problem
This issue surfaced during testing on a Debian 13 (trixie) installation.
On this system, the
ntpdversion string is formatted differently, for example:ntpd ntpsec-1.2.3Because the existing implementation relies on parsing a specific version string format, it fails (or behaves inconsistently) when encountering alternative formats such as this one. This highlights the fragility of the current approach and further demonstrates that parsing the daemon version is both unnecessary and error-prone.
Proposed Change
This PR removes the logic that attempts to determine the NTP/
ntpdversion and instead:versionfield to a static numeric value. Like every other script currently in this repository.versionfield strictly represents the script version, as documented.