1### YAML Configuration
2
3YAML is a human friendly data serialization standard for all programming languages.
4
5Refer: https://yaml.org/
6
7YAML is the main orchestrator in terms of how the user arranges the data to be
8collected in this log collection tool. The better context and syntax usage would
9improve the execution, parsing and data collection feeds to the collector engine.
10
11
12### YAML Rules
13
14The collector parser and engine needs a very minimal set of rules user need to
15follow while writing a YAML block. The YAML standards applies as usual.
16
17```
18<Block identifier>
19    <Sub block for a given protocol group>:
20        COMMANDS:
21            - <command>
22        FILES:
23            - <file name to save log>
24        PROTOCOL:
25            - <supported currently SSH, TELNET, SCP, SHELL>
26```
27
28This block statement in YAML one must follow for the collector to do operation
29successfully.
30
31COMMANDS, FILES, PROTOCOL is mandatory for all YAML block.
32
33Note: The FILES directive is not needed for protocol using SCP (Refer YAML Block Example)
34
35
36### YAML Block Examples
37
38Generic syntax usage:
39
40```
41OPENBMC:
42    OPENBMC_LOGS:
43        COMMANDS:
44            - 'peltool -l >/tmp/PEL_logs_list.json'
45        FILES:
46            - '/tmp/PEL_logs_list.json'
47        PROTOCOL:
48            - 'SSH'
49
50    # DUMP_LOGS: This section provides option to 'SCP if file exist'.
51    DUMP_LOGS:
52        COMMANDS:
53            - 'ls -AX /var/lib/systemd/coredump/core.*'
54        PROTOCOL:
55            - 'SCP'
56
57    # File contains the data returned from 'redfishtool GET URL'
58    REDFISH_LOGS:
59        COMMANDS:
60            - redfishtool -u ${username} -p ${password} -r ${hostname} -S Always raw GET /redfish/v1/AccountService/Accounts
61        FILES:
62            - 'REDFISH_bmc_user_accounts.json'
63        PROTOCOL:
64            - 'REDFISH'
65
66    # Commands and Files to collect for via out of band IPMI.
67    IPMI_LOGS:
68        COMMANDS:
69            - ipmitool -I lanplus -C 17 -U ${username} -P ${password} -H ${hostname} lan print
70        FILES:
71            - 'IPMI_LAN_print.txt'
72        PROTOCOL:
73            - 'IPMI'
74
75```
76
77Example of using plugin in YAML (Refer plugin documentation)
78
79```
80OPENBMC:
81    REDFISH_LOGS:
82        COMMANDS
83            - plugin:
84              - plugin_name: plugin.redfish.enumerate_request
85              - plugin_args:
86                - ${hostname}
87                - ${username}
88                - ${password}
89                - /redfish/v1/
90                - json
91        FILES:
92            - 'REDFISH_enumerate_v1.json'
93        PROTOCOL:
94            - 'REDFISH'
95```
96