Thiago Brito c213a3832d Add flake8-import-order and use python3.9 on tox
Improving the code quality of utilities by adding the flake8 check on
zuul and adding the flake8-import-order plugin to standardize imports.
Also, defaults testenv to python3.9 configuration that should be used
for now on with the debian migration.

Story: 2010100
Task: 45671
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I007302bdfb873aed4ebb7b9023db2461282b9fba
2022-09-13 21:49:41 +00:00
..
2022-08-19 10:44:43 -04:00
2022-08-19 10:44:43 -04:00

Refer to report.py file header for a description of the tool

Example:

Consider the following collect bundle structure

SELECT_NODES_20220527.193605
├── controller-0_20220527.193605
│   ├── etc
│   ├── root
│   └── var
├── controller-1_20220527.193605
│   ├── etc
│   ├── root
│   └── var
├── plugins         (where the plugin files will be placed)
│   ├── alarm_plugin_example
│   └── substring_plugin_example
├── report
    └── tool      (where the tool will be placed)
    └── output    (where the output files will be placed)


> cat plugins/alarm_plugin_example

algorithm=alarm
alarm_ids=400.,401.
entity_ids = host=controller-0

> cat plugins/substring_plugin_example

algorithm=substring
files=var/log/mtcAgent.log
hosts=controllers
substring=operation failed

> report/tool/report.py --start 20220501 --end 20220530

Running the command above will populate the report folder with output files.
The tool also provides default values, more details are in 'report.py -h'.

The substring algorithm creates an output file for every host of the
specified host type. The files will contain log events within the
provided date range containing the substring 'operation failed'.

The alarm algorithm creates two output file: 'log' and 'alarm'
'log' contains customer log messages created within the provided date range,
and 'alarm' contains system alarms created within the provided date range.

For more detailed information about an algorithm use 'report.py <algorithm> -h'.

Here is the report directory after running the above command

report
├── output
│   └── 20220815.140008 (time in utc when tool was ran)
│       ├── alarm
│       ├── controller-0_substring_plugin_example_substring
│       ├── controller-1_substring_plugin_example_substring
│       ├── report.log (log file for report tool)
│       └── log
└── tool    (where the report tool is)