Bug 56378 - cron error mail every 5m by univention-monitoring-client/scripts/check_univention_replication when unjoined
cron error mail every 5m by univention-monitoring-client/scripts/check_univen...
Status: NEW
Product: UCS
Classification: Unclassified
Component: Monitoring (Prometheus or Nagios)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on: 56092
Blocks: 56454 56455
  Show dependency treegraph
 
Reported: 2023-07-31 13:03 CEST by Philipp Hahn
Modified: 2023-08-18 12:51 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.006
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
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 Philipp Hahn univentionstaff 2023-07-31 13:03:32 CEST
/etc/cron.d/univention-monitoring-client runs
  run-parts /usr/share/univention-monitoring-client/scripts/
every 5 minutes, which calls
  /usr/share/univention-monitoring-client/scripts/check_univention_replication
which calls
  get_notifier_id.py
printing
  usage: get_notifier_id.py [-h] [-m MASTER] [-s]
  get_notifier_id.py: error: ldap/master or --master not set
when the system is not joined yet.

root@korpon:~# grep -c get_notifier_id.py /var/mail/systemmail 
106654
Comment 1 Philipp Hahn univentionstaff 2023-07-31 13:05:45 CEST
root@flytta:~# grep -c get_notifier_id.py /var/mail/systemmail
106472
Comment 2 Florian Best univentionstaff 2023-07-31 13:51:28 CEST
What now?

1. Set "monitoring/client/cron" in the joinscript instead of as default value. Then reload crond.service in the joinscript.

2. fix the specific script to handle this situation?
Comment 3 Philipp Hahn univentionstaff 2023-07-31 14:48:21 CEST
(In reply to Florian Best from comment #2)
> What now?

Scripts should not run / fail silently if their pre-condition is not met, e.g.

[ -f /var/univention-join/joined ] || exit 0

At least
> result = subprocess.check_output(['/usr/share/univention-directory-listener/get_notifier_id.py'])
should use
> …, stderr=subprocess.DEVNULL
to silence its error output which otherwise CRON will collect and mail.