Skip to content

BUG REPORT: check_ntp_offset on Windows with french language #224

Open
k9fr4n/snclient
#3

Description

@k9fr4n

Describe the bug
check_ntp_offset does not work when Windows is installed with French language
I think the response parsing of the command is not working

i got this respond:

CRITICAL - w32tm.exe: Erreur lors de la dernire synchronisation: 0 (La commande s'est termine correctement.) 

Screenshots
when i run the "w32tm.exe /query /status /verbose" command:

PS C:\Windows\system32> w32tm.exe /query /status /verbose
Indicateur de dérive : 0(Aucun avertissement)
Couche : 4 (Référence secondaire, synchronisée par (S)NTP)
Précision : -23 (119.209ns par battement)
Délai de racine : 0.0031091s
Dispersion de racine : 0.0483959s
ID de référence : 0xC0A88202 (IP de la source :  192.168.130.2)
Heure de la dernière synchronisation réussie : 14/04/2025 14:50:54
Source : APO-AD-03.domatel.local
Intervalle d’interrogation : 9 (512s)

Décalage de phase : -0.0001991s
Fréquence d’horloge : 0.0156249s
Ordinateur d’état : 2 (Synchroniser)
Indicateur de source de temps : 0 (Aucun)
Rôle de serveur : 576 (Service de temps fiable)
Erreur lors de la dernière synchronisation : 0 (La commande s’est terminée correctement.)
Durée écoulée depuis l’heure de la dernière synchronisation réussie : 70.4556861s

when i run the command manually everything works fine

some logs:

[2025-04-14 14:15:36.586][Trace][pid:23876][checkdata:134] finalize check results:
[2025-04-14 14:15:36.586][Debug][pid:23876][checkdata:142] filter:             none
[2025-04-14 14:15:36.586][Debug][pid:23876][checkdata:143] condition  warning: offset > 250 || offset < -250
[2025-04-14 14:15:36.586][Debug][pid:23876][checkdata:144] condition critical: offset > 500 || offset < -500
[2025-04-14 14:15:36.586][Debug][pid:23876][checkdata:145] condition       ok: none
[2025-04-14 14:15:36.586][Trace][pid:23876][checkdata:147] details: map[string]string{"_state":"0", "detail-syntax":"offset ${offset_seconds:duration} from ${server}", "empty-syntax":"%(status) - could not get any ntp data", "ok-syntax":"", "top-syntax":"%(status) - ${list}"}
[2025-04-14 14:15:36.586][Trace][pid:23876][checkdata:165] list data:
[2025-04-14 14:15:36.586][Trace][pid:23876][checkdata:177]  - map[string]string{"_error":"w32tm.exe: Erreur lors de la derni\x8are synchronisation\xff: 0 (La commande s'est termin\x82e correctement.)", "_exit":"2", "jitter":"", "offset":"", "offset_seconds":"", "server":"", "source":"w32tm", "stratum":""}
[2025-04-14 14:15:36.587][Debug][pid:23876][listener:328] nrpe connection from 10.200.13.4:42924 finished in 195.5582ms

Software (please complete the following information):

  • OS [Windows Server 2022 French]
  • Architecture [x86]
  • SNClient Version [v0.32]

Activity

  1. k9fr4n commented on Feb 12, 2026

    @k9fr4n
    Author

    Hi,
    please found a suggestion to resolve this issue:
    #336
    Regards

  2. sni commented on Feb 12, 2026

    @sni
    Contributor

    is this still necessary? There is a pattern based parser already.

  3. k9fr4n commented on Feb 12, 2026

    @k9fr4n
    Author

    it's still not working on the latest version

    ./check_nrpe -H 192.168.0.5 -u -c check_snclient_version
    SNClient v0.41 (Build: a452d66, go1.25.5) |'version'=0.41
    ./check_nrpe -H 192.168.0.5 -u -c check_ntp_offset
    CRITICAL - w32tm.exe: Erreur lors de la derni�re synchronisation�: 0 (La commande s'est termin�e correctement.)
    
  4. k9fr4n commented on Feb 13, 2026

    @k9fr4n
    Author

    a new merge #338

  5. k9fr4n commented on Feb 26, 2026

    @k9fr4n
    Author

    A simpler approach would be to use this powershell command.
    It allows you to return the "Last Sync Error" code:

    [regex]::Match((w32tm /query /status /verbose)[-3], ':\s*(\d+)\s*\(').Groups[1].Value
    
  6. sni commented on Feb 26, 2026

    @sni
    Contributor

    well, that's basically what snclient does on windows, except we try to parse more values in order to provide performance data along with a status.

  7. k9fr4n commented on Nov 9, 2026

    @k9fr4n
    Author

    Hi @sni, I looked into this and opened #494 with a fix. Could you have a look when you get a moment? Tested against real output from a French Windows Server 2025.

  8. sni commented on Nov 9, 2026

    @sni
    Contributor

    i already commented there, we are working on a non-locale dependent solution in #489

  9. k9fr4n commented on Nov 9, 2026

    @k9fr4n
    Author

    Hi @sni, small heads-up from testing: I tried PR #489 on a French Windows Server 2025 lab box. The new w32time source works fine in French, but when using source=w32tm the French parsing problem from this issue is still there — it reports the "Erreur lors de la dernière synchronisation" line as CRITICAL. So #494 is still needed for the w32tm path. Happy to help test further if needed.

  10. inqrphl commented on Nov 13, 2026

    @inqrphl
    Contributor

    The check_ntp_offset w32time was merged into the main.

    You can grab the artifacts for testing here:

    https://github.com/ConSol-Monitoring/snclient/actions/runs/43254183540

    The w32time.dll method has predence over w32tm.exe , so by default it should use the universtal method, not triggering this bug.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions