Bug 56110 - The check_univention_ntp script use the host, even though is set an external timeserver per ucrv
The check_univention_ntp script use the host, even though is set an external ...
Status: NEW
Product: UCS
Classification: Unclassified
Component: UCR
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-06-01 14:59 CEST by Mirac Erdemiroglu
Modified: 2023-06-02 12:15 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.023
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023052621000306
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mirac Erdemiroglu univentionstaff 2023-06-01 14:59:07 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
Comment 1 Mirac Erdemiroglu univentionstaff 2023-06-01 15:02:50 CEST
Customer affected Ticket 2023052621000306
UCS 5.0-3
Comment 2 Mirac Erdemiroglu univentionstaff 2023-06-02 12:14:57 CEST
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