Skip to content

Changed ntp-client script version to static "1"#596

Open
tim427 wants to merge 1 commit intolibrenms:masterfrom
tim427:fix-ntp-client
Open

Changed ntp-client script version to static "1"#596
tim427 wants to merge 1 commit intolibrenms:masterfrom
tim427:fix-ntp-client

Conversation

@tim427
Copy link
Contributor

@tim427 tim427 commented Feb 23, 2026

Simplify version handling in ntp-client extend script

This pull request corrects and simplifies how the version field is handled in the ntp-client SNMP extend script.

Background

The current implementation attempts to determine the NTP protocol version by parsing runtime information. However:

  1. The logic does not actually retrieve the NTP protocol version.
  2. Instead, it tries to extract the ntpd software version, which is something entirely different.
  3. More importantly, this is conceptually incorrect for LibreNMS.

As documented in includes/polling/functions.inc.php:

version - The version of the snmp extend script. Should be numeric and at least 1.

The version field is intended to represent the version of the SNMP extend script itself (in this case, ntp-client), not:

  • the NTP protocol version, nor
  • the ntpd software version installed on the system.

Problem

This issue surfaced during testing on a Debian 13 (trixie) installation.

On this system, the ntpd version string is formatted differently, for example: ntpd ntpsec-1.2.3

Because 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/ntpd version and instead:

  • Sets the version field to a static numeric value. Like every other script currently in this repository.
  • Ensures the version field strictly represents the script version, as documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant