Bug 55017 - check_univention_ntp: ValueError: could not convert string to float:
check_univention_ntp: ValueError: could not convert string to float:
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Monitoring (Prometheus or Nagios)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Florian Best
Siavash Sefid Rodi
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-20 23:29 CEST by Florian Best
Modified: 2022-08-03 17:08 CEST (History)
1 user (show)

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?: 2: Will only affect a 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.046
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022072521000351
Bug group (optional): bitesize, Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2022-07-20 23:29:22 CEST
The following traceback was reported here: https://help.univention.com/t/monitoring-cron-script-failure/20124/11

Traceback (most recent call last):
  File “/usr/share/univention-monitoring-client/scripts//check_univention_ntp”, line 46, in
    NTP.main()
  File “/usr/lib/python3/dist-packages/univention/monitoring/init.py”, line 74, in main
    self.write_metrics()
  File “/usr/share/univention-monitoring-client/scripts//check_univention_ntp”, line 40, in write_metrics
    ntp_offset = float(output.split(’|’, 1)[-1].split(’;’)[0].split(’=’)[-1].rstrip(‘s’))
ValueError: could not convert string to float:
run-parts: /usr/share/univention-monitoring-client/scripts//check_univention_ntp exited with return code 1
Comment 1 Florian Best univentionstaff 2022-07-22 10:53:13 CEST
One reproducer is for example `systemctl stop ntp.service`.
The error has been fixed and a error message is logged instead.
The absent() query expression will detect that state.

univention-monitoring-client.yaml
0b547b3e50c6 | Bug #55017: fix check_univention_ntp in error conditions

univention-monitoring-client (1.0.0-6)
0b547b3e50c6 | Bug #55017: fix check_univention_ntp in error conditions
Comment 2 Dirk Schnick univentionstaff 2022-07-25 14:45:28 CEST
Attached a customer ticket.
Comment 3 Siavash Sefid Rodi univentionstaff 2022-07-28 16:19:28 CEST
OK: no exception in case of ntp not running, log debug instead