Univention Bugzilla – Bug 56110
The check_univention_ntp script use the host, even though is set an external timeserver per ucrv
Last modified: 2023-06-02 12:15:10 CEST
UCS: 5.0-3 errata668 I could reproduce this issue on my test system. If you set external timerserver per ucrv ucr search --brief timeserver timeserver2: nissedal.knut.univention.de burst timeserver3: antilop.knut.univention.de burst timeserver: 0.de.pool.ntp.org the script /usr/share/univention-monitoring-client/scripts/check_univention_ntp will try to contact and use the host for timeserver: grep ntp /tmp/strace 2773 execve("./check_univention_ntp", ["./check_univention_ntp"], 0x7ffea0c51cd8 /* 28 vars */) = 0 2773 stat("./check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 2773 openat(AT_FDCWD, "./check_univention_ntp", O_RDONLY) = 3 2773 stat("./check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 2773 readlink("./check_univention_ntp", 0x7ffcd03fe380, 4096) = -1 EINVAL (Das Argument ist ungültig) 2773 lstat("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 2773 openat(AT_FDCWD, "./check_univention_ntp", O_RDONLY) = 3 2773 openat(AT_FDCWD, "/var/lib/prometheus/node-exporter/check_univention_ntp.prom", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 3 2774 execve("/usr/lib/nagios/plugins/check_ntp_time", ["/usr/lib/nagios/plugins/check_nt"..., "-H", "dc0"], 0x7ff19dca9400 /* 1 var */ <unf inished ...> 2773 write(3, "univention_ntp_offset_seconds{in"..., 75) = 75
Customer affected Ticket 2023052621000306 UCS 5.0-3
The check for ntp in /usr/share/univention-monitoring-client/scripts/check_univention_ntp just check the time with the host self and not to the timeserver, like it should do. I set the my timeserver external ucr search --brief timeserver timeserver2: nissedal.knut.univention.de burst timeserver3: antilop.knut.univention.de burst timeserver: 0.de.pool.ntp.org and changed my system time to root@dc0:~# date Fr 2. Jun 05:08:00 CEST 2023 root@dc0:~# grep ntp /tmp/strace 26348 execve("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", ["/usr/share/univention-monitoring"...], 0x7ffe6cc994c8 /* 27 vars */) = 0 26348 stat("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 26348 openat(AT_FDCWD, "/usr/share/univention-monitoring-client/scripts/check_univention_ntp", O_RDONLY) = 3 26348 stat("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 26348 readlink("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", 0x7ffc4f96e530, 4096) = -1 EINVAL (Das Argument ist ungültig) 26348 lstat("/usr/share/univention-monitoring-client/scripts/check_univention_ntp", {st_mode=S_IFREG|0755, st_size=1929, ...}) = 0 26348 openat(AT_FDCWD, "/usr/share/univention-monitoring-client/scripts/check_univention_ntp", O_RDONLY) = 3 26348 openat(AT_FDCWD, "/var/lib/prometheus/node-exporter/check_univention_ntp.prom", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 3 26349 execve("/usr/lib/nagios/plugins/check_ntp_time", ["/usr/lib/nagios/plugins/check_nt"..., "-H", "dc0"], 0x7f1320824400 /* 1 var */) = 0 26348 write(3, "univention_ntp_offset_seconds{in"..., 75) = 75 so the setting for the timeserver will not considered from the check_univention_ntp