Bug 54985 - can't remove monitoringAlerts from domaincontroller master object
can't remove monitoringAlerts from domaincontroller master object
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Florian Best
Siavash Sefid Rodi
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-13 17:55 CEST by Ingo Steuwer
Modified: 2022-07-20 18:20 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of 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.137
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 Ingo Steuwer univentionstaff 2022-07-13 17:55:28 CEST
I can't remove an assigned alert from the domaincontroller master object using UDM, neither in the UMC nor on the commandline:

* trying "--remove":

root@ucs-4942:/# udm computers/domaincontroller_master list |egrep 'DN:|UNIVENTION_JOINSTATUS_WARNING'
DN: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
  monitoringAlerts: cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet
root@ucs-4942:/# udm computers/domaincontroller_master modify --dn cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet --remove monitoringAlerts="cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet"
Object modified: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
root@ucs-4942:/# udm computers/domaincontroller_master list |egrep 'DN:|UNIVENTION_JOINSTATUS_WARNING'
DN: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
  monitoringAlerts: cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet

* trying to set the attribute to an empty string:

root@ucs-4942:/# udm computers/domaincontroller_master modify --dn cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet --set monitoringAlerts=""
Object modified: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
root@ucs-4942:/# udm computers/domaincontroller_master list |egrep 'DN:|UNIVENTION_JOINSTATUS_WARNING'
DN: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
  monitoringAlerts: cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet


"append" seems to work, at least it throws reasonable errors:

root@ucs-4942:/# udm computers/domaincontroller_master modify --dn cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet --append monitoringAlerts="cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet"
WARNING: cannot append cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=steuwer-test,dc=intranet to monitoringAlerts, value exists
No modification: cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet
root@ucs-4942:/# udm computers/domaincontroller_master modify --dn cn=ucs-4942,cn=dc,cn=computers,dc=steuwer-test,dc=intranet --append monitoringAlerts="cn=UNIVENTION_JOINSTATUS_WARNING-2,cn=monitoring,dc=steuwer-test,dc=intranet"
E: object not found
Comment 1 Florian Best univentionstaff 2022-07-13 18:39:36 CEST
Workaround: the opposite way:

udm monitoring/alert modify --dn "cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,$ldap_base" --remove assignedHosts="$ldap_hostdn"
Comment 2 Florian Best univentionstaff 2022-07-13 19:30:03 CEST
Fix is part of the MR in https://git.knut.univention.de/univention/ucs/-/merge_requests/440 and requires an update of the joinscript version as it registers an UDM hook in LDAP.
Comment 3 Florian Best univentionstaff 2022-07-18 15:49:57 CEST
The hook has been adjusted to unassign hosts.

univention-monitoring-client.yaml
57e5aa0087ba | YAML Bug #54947, Bug #54985

univention-monitoring-client (1.0.0-5)
e1b62c1ead16 | Bug #54985: fix unassigning monitoringAlerts from computer objects
Comment 4 Siavash Sefid Rodi univentionstaff 2022-07-19 09:56:31 CEST
OK:

root@ucs-2742:~# udm computers/domaincontroller_master list |egrep 'DN:|UNIVENTION_JOINSTATUS_WARNING'
DN: cn=ucs-2742,cn=dc,cn=computers,dc=mydomain,dc=intranet
  monitoringAlerts: cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=mydomain,dc=intranet


root@ucs-2742:~# udm computers/domaincontroller_master modify --dn cn=ucs-2742,cn=dc,cn=computers,dc=mydomain,dc=intranet --remove monitoringAlerts="cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=mydomain,dc=intranet"
Object modified: cn=ucs-2742,cn=dc,cn=computers,dc=mydomain,dc=intranet



root@ucs-2742:~# udm computers/domaincontroller_master list |egrep 'DN:|UNIVENTION_JOINSTATUS_WARNING'
DN: cn=ucs-2742,cn=dc,cn=computers,dc=mydomain,dc=intranet


Same behavior in UMC and with 

udm monitoring/alert modify --dn "cn=UNIVENTION_JOINSTATUS_WARNING,cn=monitoring,dc=mydomain,dc=intranet" --remove assignedHosts="cn=ucs-2742,cn=dc,cn=computers,dc=mydomain,dc=intranet"