Yang Lu f7f3c59410 Report Tool: Log Event Reporter
The Report tool helps with the debugging process by aggregating
relevant log events and information from collect bundle, and
presenting them in output files.

The tool allows users to create plugin files which contain
specifications for what log events/information to gather.

Users also have the option of using information gathering
algorithms directly in the command line without creating
a plugin file.

The tool features context sensitive help messages for
every algorithm.

Tests:

PASS: Verify substring algorithm is working
PASS: Verify alarm algorithm is working
PASS: Verify system info algorithm is working
PASS: Verify swact activity algorithm is working
PASS: Verify puppet log error algorithm is working
PASS: Verify process failure algorithm is working
PASS: Verify the tool works on different collect bundles
PASS: Verify context sensitive help is working
PASS: Verify running algorithms in command line is working
PASS: Verify plugin file verification is working
PASS: Verify plugins do not take too long to run
PASS: Verify report tool logging logs proper info and errors

Story: 2010166
Task: 45841
Signed-off-by: Yang Lu <yang.lu@windriver.com>
Change-Id: I6f2439e5268a10bf5c70712c8863a6893c1a16b9
2022-08-19 10:44:43 -04:00

63 lines
2.0 KiB
Plaintext

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)