Bug 34765 - UMC - System diagnostic module
UMC - System diagnostic module
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UNSTABLE
Other Linux
: P5 enhancement (vote)
: UCS 4.0
Assigned To: Florian Best
Alexander Kläser
: interim-3
Depends on:
Blocks: 40461
  Show dependency treegraph
 
Reported: 2014-05-07 15:34 CEST by Lukas Walter
Modified: 2016-01-19 20:11 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
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 Lukas Walter univentionstaff 2014-05-07 15:34:21 CEST
There should be an UMC module capable of analysing the system for known issues, such as ... :
  - insufficient memory
  - hard drives which ran out of space
  - modified UCR templates
  - problematic combinitions of Samba3/Samba4
  - etc.

I could most likey reduce the support effort by trying to suggest solutions to found problems.
Comment 1 Lukas Walter univentionstaff 2014-05-07 15:55:05 CEST
A POOC implementation which could be used for further development has already been added: ucs-3.2/component/univention-management-console-module-supphealth
Comment 2 Alexander Kläser univentionstaff 2014-05-08 11:19:18 CEST
(In reply to Lukas Walter from comment #1)
> A POOC implementation which could be used for further development has
> already been added:
> ucs-3.2/component/univention-management-console-module-supphealth

Thanks! I created the folder "ucs-3.2/component/support-health" and moved the UMC module in there.
Comment 3 Alexander Kläser univentionstaff 2014-09-02 12:20:53 CEST
Question: with the centralized approaches (App Center, updates) coming with UCS4, do we also want to have this module collecting and displaying results from different servers?
Comment 4 Alexander Kläser univentionstaff 2014-09-03 11:36:37 CEST
(In reply to Alexander Kläser from comment #3)
> Question: with the centralized approaches (App Center, updates) coming with
> UCS4, do we also want to have this module collecting and displaying results
> from different servers?

→ as a first step no centralized approach.
Comment 5 Alexander Kläser univentionstaff 2014-09-03 11:37:19 CEST
@Alex Kr.: Could you migrate this UMC module as a first step to the UCS4 scope such that it can be installed?
Comment 6 Alexander Kramer univentionstaff 2014-09-03 16:00:09 CEST
r53302 Added UMC Support Health Module to UCS 4.0 Branch
Comment 7 Alexander Kramer univentionstaff 2014-09-03 16:25:59 CEST
r53305
I'm a little bit unsure about increasing the changelog in this case.
I increase it from (0.1.0-1) to (1.0.0-1)


Updated the hashbangs from python2.6 to 2.7
Increased the compat lvl
Added version 2.7 to XS-Python-Version
Added python-support to debian/rules

Didn't find any conffiles. Please tell me if i missed something.

The copyright is already up to date
Comment 8 Alexander Kramer univentionstaff 2014-09-03 16:42:58 CEST
r53309
Moved the module from component/support-health to ucs-4.0-0/management
Comment 9 Alexander Kramer univentionstaff 2014-09-04 10:28:55 CEST
r53345 Adapted the changelog
Comment 10 Alexander Kramer univentionstaff 2014-09-04 10:55:40 CEST
Successful build
Package: univention-management-console-module-supphealth
Version: 1.0.0-1.1.201409041034
Branch: ucs_4.0-0

Also build it locally and installed it. Works fine.
Comment 11 Alexander Kläser univentionstaff 2014-09-04 12:26:54 CEST
The package has been moved to UCS4, however, the module itself might need some more adaptations → therefore REOPEN
Comment 12 Stefan Gohmann univentionstaff 2014-09-09 16:31:03 CEST
The module is installable. Please change the following issues:

- The module should be renamed to univention-management-console-module-supporthealth

- The package has a dependency to devscripts which need a lot of other packages. This shouldn't be needed.


Some more general changes:

- The plugins must be more interactive. For example the "Consistency of UCR templates" should offer the opportunity to copy the files back.

- I think we should load python files instead of bash scripts. Otherwise such an interaction is difficult.

- The Samba 3 / Samba 4 test should be removed.

- The module texts should be localized.

- It should be possible to run a test from the detailed page
Comment 13 Stefan Gohmann univentionstaff 2014-09-10 07:47:28 CEST
(In reply to Stefan Gohmann from comment #12)
> - The module should be renamed to
> univention-management-console-module-supporthealth

Better rename the package to univention-management-console-module-system-diagnostic and rename the module from "Basis system diagnosis" to "System diagnostic".
Comment 14 Stefan Gohmann univentionstaff 2014-09-11 08:41:40 CEST
I've tagged these modules to UCS 4.0 MS2: 
 Bug #35866 - Too many open files messages in samba logfiles
 Bug #35864 - Network setup check

All other existing modules should be removed.
Comment 15 Florian Best univentionstaff 2014-10-01 12:59:26 CEST
Please pick one german title:
System-Diagnoseprüfung
System-Fehlersuchprogramm
System-Fehlerdiagnose
System-Diagnose
System-Problemdiagnose

I commited and built one first version.
The module has been renamed to univention-management-console-module-diagnostic.
Whole module is currently untranslated. Texts have to be adapted.
The detailpage and the grid have been removed.
The bash compatibility has been removed (it's very easy to implement such things with subprocess).

Technical background:
There is a new python package called "univention.management.console.modules.diagnostic.plugins" which contains every diagnosis plugin as a regular python module.
These python modules have some useful properties:
* title → short problem description
* description → a more detailed description of the problem which are able to contain HTML and where specific patterns are replaced by links to umc modules/sdb articles.
* umc_modules → links to umc_modules, flavors, etc.
* link → regular inline text links (e.g. to SDB articles)
* buttons → buttons which can define more actions (e.g. an automatic repair, etc.)
* actions: callbacks for the actions defined as buttons

The module have to define at least a run() function which may raise any of the following exceptions:

Problem
 +-- Success
 +-- Conflict
 +-- Warning
 +-- Critical
 +-- ProblemFixed

These exceptions allow the same attributes as the module / are overwriting the module attributes for the execution of that specific test.
Comment 16 Florian Best univentionstaff 2014-10-01 13:08:32 CEST
Module has been added to the univention-management-console dependencies.
Comment 17 Stefan Gohmann univentionstaff 2014-10-02 06:15:18 CEST
I saw this traceback in the latest Jenkins test:

Configure /usr/lib/univention-install/35univention-management-console-module-diagnostic.inst
from univention.lib.umc_module import MIME_DESCRIPTION
  File "/usr/lib/pymodules/python2.7/univention/lib/umc_module.py", line 4, in <module>
    from PIL import Image
ImportError: No module named PIL

http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-0/job/Autotest%20MultiEnv/SambaVersion=s3,Systemrolle=master/lastSuccessfulBuild/artifact/autotest-090-master-s3.log
Comment 18 Stefan Gohmann univentionstaff 2014-10-02 06:22:02 CEST
(In reply to Stefan Gohmann from comment #17)
> I saw this traceback in the latest Jenkins test:
> 
> Configure
> /usr/lib/univention-install/35univention-management-console-module-
> diagnostic.inst
> from univention.lib.umc_module import MIME_DESCRIPTION
>   File "/usr/lib/pymodules/python2.7/univention/lib/umc_module.py", line 4,
> in <module>
>     from PIL import Image
> ImportError: No module named PIL
> 
> http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-0/job/
> Autotest%20MultiEnv/SambaVersion=s3,Systemrolle=master/lastSuccessfulBuild/
> artifact/autotest-090-master-s3.log

This problem happens not only in the diagnostic join script and it seems to be a generic problem. I've created a new bug for it: Bug #36037
Comment 19 Alexander Kläser univentionstaff 2014-10-06 16:22:26 CEST
When running the module, I get the following problem reported:

> Security limits exceeded
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 170, in execute
>     result = execute(**kwargs)
>   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/security_limits.py", line 42, in run
>     with open('/var/log/samba/log.smbd', 'rb') as fd:
> IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: '/var/log/samba/log.smbd'

I guess the check should make sure that samba is installed.
Comment 20 Florian Best univentionstaff 2014-10-06 16:48:51 CEST
* Removed devscripts dependency
* Added dependency for pycurl, dnspython and psutil
* Added translation
* Catch IOError if Samba is not installed
Comment 21 Alexander Kläser univentionstaff 2014-10-06 16:59:50 CEST
The following suggestions:
* Usability problem:
  * 1 problem occurs
  * Problem fixed + run test again
  * This results in an empty main area, at least the success message should be 
    shown again
* Success message:
  * Here you can set the TitlePane property toggleable=false
* Rather then colors for "Error:" / "Success:", you could have this part 
  dark colored + bold and the main message normal in its font weight;
  you could then order them from criticial downwards in their priority

Another traceback:
> Traceback (most recent call last):
>   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 170, in execute
>     result = execute(**kwargs)
>   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/security_limits.py", line 54, in run
>     if counter and hard < suggested_limit_hard or soft < suggested_limit_soft:
UnboundLocalError: local variable 'counter' referenced before assignment
Comment 22 Alexander Kläser univentionstaff 2014-10-06 17:44:48 CEST
The following points would be nice:
* Use a Dgrid directly instead of GalleryPane, i.e., inheriting from dgrid/List + dgrid/extensions/DijitRegistry.
* Use an external CSS file for static CSS rules
* Could you please add the some help documentation to the Plugin class? (mainly what you have written at this Bug + some more information on how actions is related to buttons, merging of umc_modules / links into description.
Comment 23 Alexander Kläser univentionstaff 2014-10-06 17:47:27 CEST
(In reply to Alexander Kläser from comment #22)
> The following points would be nice:
> * Use a Dgrid directly instead of GalleryPane, i.e., inheriting from
> dgrid/List + dgrid/extensions/DijitRegistry.

Here the following observations:
* You are using put + domConstruct, this should not be necessary
* Probably you can do as well:
> new TitlePane({content: widget})
... and then:
> return titlepane.contentNode
Comment 24 Stefan Gohmann univentionstaff 2014-10-19 19:52:44 CEST
Move all unfinished MS1 and MS2 bugs to RC.
Comment 25 Stefan Gohmann univentionstaff 2014-10-22 07:21:23 CEST
Currently, I'm unable to open the UMC module.
Comment 26 Florian Best univentionstaff 2014-10-23 11:56:06 CEST
(In reply to Alexander Kläser from comment #21)
> The following suggestions:
> * Usability problem:
>   * 1 problem occurs
>   * Problem fixed + run test again
>   * This results in an empty main area, at least the success message should
> be shown again
→ Fixed

> * Success message:
>   * Here you can set the TitlePane property toggleable=false
→ Done
> * Rather then colors for "Error:" / "Success:", you could have this part 
>   dark colored + bold and the main message normal in its font weight;
>   you could then order them from criticial downwards in their priority
→ Order fixed, color remain there.
 
> Another traceback:
> > Traceback (most recent call last):
> >   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 170, in execute
> >     result = execute(**kwargs)
> >   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/security_limits.py", line 54, in run
> >     if counter and hard < suggested_limit_hard or soft < suggested_limit_soft:
> UnboundLocalError: local variable 'counter' referenced before assignment
→ fixed

(In reply to Alexander Kläser from comment #22)
> The following points would be nice:
> * Use a Dgrid directly instead of GalleryPane, i.e., inheriting from
> dgrid/List + dgrid/extensions/DijitRegistry.
→ OK, i needed to copy some styles and methods
> * Use an external CSS file for static CSS rules
→ done
> * Could you please add the some help documentation to the Plugin class?
> (mainly what you have written at this Bug + some more information on how
> actions is related to buttons, merging of umc_modules / links into
> description.
→ docstring added

(In reply to Stefan Gohmann from comment #25)
> Currently, I'm unable to open the UMC module.
Oh yes, didn't commit debian/changelog so the old code was built.
Comment 27 Alexander Kläser univentionstaff 2014-10-30 11:10:14 CET
I needed to fix the wrapping, otherwise lines would be cut on small screens.

univention-management-console-module-diagnostic (1.0.10-1):
* Bug #34765: fix word wrapping on small screens
Comment 28 Alexander Kläser univentionstaff 2014-11-05 18:13:19 CET
(In reply to Florian Best from comment #26)
> (In reply to Alexander Kläser from comment #21)
> > The following suggestions:
> > * Usability problem:
> >   * 1 problem occurs
> >   * Problem fixed + run test again
> >   * This results in an empty main area, at least the success message should
> > be shown again
> → Fixed

OK

> > * Success message:
> >   * Here you can set the TitlePane property toggleable=false
> → Done

OK

> > * Rather then colors for "Error:" / "Success:", you could have this part 
> >   dark colored + bold and the main message normal in its font weight;
> >   you could then order them from criticial downwards in their priority
> → Order fixed, color remain there.

OK
 
> > Another traceback:
> > > Traceback (most recent call last):
> > >   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 170, in execute
> > >     result = execute(**kwargs)
> > >   File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/security_limits.py", line 54, in run
> > >     if counter and hard < suggested_limit_hard or soft < suggested_limit_soft:
> > UnboundLocalError: local variable 'counter' referenced before assignment
> → fixed

OK

> (In reply to Alexander Kläser from comment #22)
> > The following points would be nice:
> > * Use a Dgrid directly instead of GalleryPane, i.e., inheriting from
> > dgrid/List + dgrid/extensions/DijitRegistry.
> → OK, i needed to copy some styles and methods

OK

> > * Use an external CSS file for static CSS rules
> → done

OK

> > * Could you please add the some help documentation to the Plugin class?
> > (mainly what you have written at this Bug + some more information on how
> > actions is related to buttons, merging of umc_modules / links into
> > description.
> → docstring added

Cool :) !

> (In reply to Stefan Gohmann from comment #25)
> > Currently, I'm unable to open the UMC module.
> Oh yes, didn't commit debian/changelog so the old code was built.

OK

Changelog OK (fixed a little typo).

Looks good AFAIS → VERIFIED
Comment 29 Stefan Gohmann univentionstaff 2014-11-26 06:54:34 CET
UCS 4.0-0 has been released:
 http://docs.univention.de/release-notes-4.0-0-en.html
 http://docs.univention.de/release-notes-4.0-0-de.html

If this error occurs again, please use "Clone This Bug".