Univention Bugzilla – Bug 53969
univention-run-diagnostic-checks always runs all or only one diagnostic module
Last modified: 2022-02-16 12:07:02 CET
univention-run-diagnostic-checks is only capable of running *all* or *only one* diagnostic module. For each start, credentials have to be specified. It would be great, a) if more than one module can be specified on CLI and/or b) if one or more module can be specified whose checks are skipped
This behaviour is really annoying in larger UCS@school environments where at least 911_ucsschool_consistency and 40_samba_tool_dbcheck take huge amounts of time and CPU.
Created attachment 10861 [details] Proposed solution This is proposed solution, with (hopefully) minimal changes: 1. "-l/--list" action is treated separately, with its own flag in arguments 2. "-t/--test" is a list of plugins or "all" (which remains default option) but it allows separate tests to be listed 3. "-s/--skip" is a list of tests to be skipped. By default it is empty list So use cases are as: 1. list avilable tests: python univention-run-diagnostic-checks -l or python univention-run-diagnostic-checks --list 2. execute all tests: python univention-run-diagnostic-checks or python univention-run-diagnostic-checks --test all 3. execute two specific tests: python univention-run-diagnostic-checks --test plugin_2 plugin_4 4. skip two specific tests: python univention-run-diagnostic-checks --skip plugin_2 plugin_4 Adding this to actual code is quite simple, but had to be tested
Thanks! Even if it's a proposed solution, can you create a merge request for it? You can mark the merge request as draft.
Sure, no problem.
I have created draft MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/163 ,so please take a look and comment.
Thanks. So the only difference is that the prior `-k list` is now `-l/--list` ?
I would support that as I already did last year: https://forge.univention.org/bugzilla/show_bug.cgi?id=51942#c7
719106aace | univention-run-diagnostic-checks always runs all or only one diagnostic module 5768b2b424 | Advisory update
Something still looks broken: root@primary20:~# /usr/bin/univention-run-diagnostic-checks -l Traceback (most recent call last): File "/usr/bin/univention-run-diagnostic-checks", line 151, in <module> sys.exit(CLIClient.main()) File "/usr/bin/univention-run-diagnostic-checks", line 57, in main if args.help: AttributeError: 'Namespace' object has no attribute 'help' Also, if I temporarily fix that by commenting out that block of code, then the "-l" option is never evaluated. Also this behaves kind of strange: root@primary20:~# /usr/bin/univention-run-diagnostic-checks -t 41_samba_tool_showrepl 40_samba_tool_dbcheck -s 40_samba_tool_dbcheck Domain Admin Login: Administrator Password: You can find the logging messages of the diagnostic modules at /var/log/univention/management-console-module-diagnostic.log ran 00_check_server_password successfully. ran 01_ssh_connection successfully. ran 02_certificate_check successfully. ran 03_check_notifier_replication successfully. ran 04_saml_certificate_check successfully. ran 10_gateway successfully. ran 11_nameserver successfully. ran 12_proxy successfully. ran 20_check_nameservers successfully. ran 21_check_join_status successfully. ran 22_kdc_service successfully. ran 23_check_update_sites successfully. ran 30_disk_usage successfully. ran 31_file_permissions successfully. ran 32_security_limits successfully. ran 41_samba_tool_showrepl successfully. ran 43_connectors4_rejects successfully. ran 44_well_known_sid_check successfully. ran 45_heimdal_on_samba4_dc successfully. ran 46_kerberos_ddns_update successfully. ran 50_check_ucr_templates successfully. ran 51_hostname_check successfully. ran 52_mail_acl_sync successfully. ran 53_package_status successfully. ran 54_sources_list_check successfully. ran 55_user_migration successfully. ran 56_univention_types successfully. ran 57_univention_server_role_windows successfully. ran 58_check_memberOf successfully. ran 59_ldap_server_name successfully. ran 60_old_schema_registration successfully.
https://git.knut.univention.de/univention/ucs/-/merge_requests/228
719106aace | univention-run-diagnostic-checks always runs all or only one diagnostic module 5768b2b424 | Advisory update 3ba8ad6553 | Advisory update 37df3745ee | univention-run-diagnostic-checks always runs all or only one diagnostic module 76e88dda3a | Advisory update
Verified: * Code review * Package update * Functional test: Ok (with combinations of -t & -s) * Advisory 433458a292 | Philipp improved the advisory markup
<https://errata.software-univention.de/#/?erratum=5.0x225>