@@ -17,8 +17,10 @@ The Node Scraper CLI can be used to run Node Scraper plugins on a target system.
1717options are available:
1818
1919``` sh
20- usage: node-scraper [-h] [--sys-name STRING] [--sys-location {LOCAL,REMOTE}] [--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}] [--sys-sku STRING] [--sys-platform STRING] [--plugin-configs [STRING ...]]
21- [--system-config STRING] [--connection-config STRING] [--log-path STRING] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
20+ usage: node-scraper [-h] [--sys-name STRING] [--sys-location {LOCAL,REMOTE}] [--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}]
21+ [--sys-sku STRING] [--sys-platform STRING] [--plugin-configs [STRING ...]] [--system-config STRING]
22+ [--connection-config STRING] [--log-path STRING] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
23+ [--gen-reference-config]
2224 {run-plugins,describe,gen-plugin-config} ...
2325
2426node scraper CLI
@@ -32,7 +34,7 @@ positional arguments:
3234
3335options:
3436 -h , --help show this help message and exit
35- --sys-name STRING System name (default: TheraC55 )
37+ --sys-name STRING System name (default: < my_system_name > )
3638 --sys-location {LOCAL,REMOTE}
3739 Location of target system (default: LOCAL)
3840 --sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}
@@ -49,103 +51,42 @@ options:
4951 --log-path STRING Specifies local path for node scraper logs, use ' None' to disable logging (default: .)
5052 --log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}
5153 Change python log level (default: INFO)
54+ --gen-reference-config
55+ Generate reference config from system. Writes to ./reference_config.json. (default: False)
56+
5257
5358` ` `
5459
55- The plugins to run can be specified in two ways, using a plugin JSON config file or using the
60+ # ## Subcommmands
61+
62+ Plugins to run can be specified in two ways, using a plugin JSON config file or using the
5663' run-plugins' sub command. These two options are not mutually exclusive and can be used together.
5764
58- ---
5965
60- # ## Describing Built-in Configs and Plugins
66+ 1. ** ' describe ' subcommand **
6167
6268You can use the ` describe` subcommand to display details about built-in configs or plugins.
63-
64- # ### List all built-in configs:
69+ List all built-in configs:
6570` ` ` sh
6671node-scraper describe config
6772` ` `
6873
69- # ### Show details for a specific built-in config:
74+ Show details for a specific built-in config
7075` ` ` sh
7176node-scraper describe config < config-name>
7277` ` `
7378
74- # ### List all available plugins:
79+ List all available plugins**
7580` ` ` sh
7681node-scraper describe plugin
7782` ` `
7883
79- # ### Show details for a specific plugin:
84+ Show details for a specific plugin
8085` ` ` sh
8186node-scraper describe plugin < plugin-name>
8287` ` `
8388
84- ---
85-
86- # ## Plugin Configs
87- A plugin JSON config should follow the structure of the plugin config model defined here.
88- The globals field is a dictionary of global key-value pairs; values in globals will be passed to
89- any plugin that supports the corresponding key. The plugins field should be a dictionary mapping
90- plugin names to sub-dictionaries of plugin arguments. Lastly, the result_collators attribute is
91- used to define result collator classes that will be run on the plugin results. By default, the CLI
92- adds the TableSummary result collator, which prints a summary of each plugin’s results in a
93- tabular format to the console.
94-
95- ` ` ` json
96- {
97- " globals_args" : {},
98- " plugins" : {
99- " BiosPlugin" : {
100- " analysis_args" : {
101- " exp_bios_version" : " TestBios123"
102- }
103- },
104- " RocmPlugin" : {
105- " analysis_args" : {
106- " exp_rocm_version" : " TestRocm123"
107- }
108- }
109- }
110- }
111- ` ` `
112-
113- # ## 'gen-plugin-config' sub command
114- The ' gen-plugin-config' sub command can be used to generate a plugin config JSON file for a plugin
115- or list of plugins that can then be customized. Plugin arguments which have default values will be
116- prepopulated in the JSON file, arguments without default values will have a value of ' null' .
117-
118- # ### 'gen-plugin-config' Examples
119-
120- Generate a config for the DmesgPlugin:
121- ` ` ` sh
122- node-scraper gen-plugin-config --plugins DmesgPlugin
123- ` ` `
124-
125- This would produce the following config:
126-
127- ` ` ` json
128- {
129- " global_args" : {},
130- " plugins" : {
131- " DmesgPlugin" : {
132- " collection" : true,
133- " analysis" : true,
134- " system_interaction_level" : " INTERACTIVE" ,
135- " data" : null,
136- " analysis_args" : {
137- " analysis_range_start" : null,
138- " analysis_range_end" : null,
139- " check_unknown_dmesg_errors" : true,
140- " exclude_category" : null
141- }
142- }
143- },
144- " result_collators" : {}
145- }
146- ` ` `
147-
148- # ## 'run-plugins' sub command
89+ 2. ** ' run-plugins' sub command**
14990The plugins to run and their associated arguments can also be specified directly on the CLI using
15091the ' run-plugins' sub-command. Using this sub-command you can specify a plugin name followed by
15192the arguments for that particular plugin. Multiple plugins can be specified at once.
@@ -167,7 +108,7 @@ options:
167108
168109` ` `
169110
170- # ### 'run-plugins' Examples
111+ Examples
171112
172113Run a single plugin
173114` ` ` sh
@@ -191,8 +132,69 @@ Use plugin configs and 'run-plugins'
191132node-scraper run-plugins BiosPlugin
192133` ` `
193134
135+ 3. ** ' gen-plugin-config' sub command**
136+ The ' gen-plugin-config' sub command can be used to generate a plugin config JSON file for a plugin
137+ or list of plugins that can then be customized. Plugin arguments which have default values will be
138+ prepopulated in the JSON file, arguments without default values will have a value of ' null' .
139+
140+ Examples
141+
142+ Generate a config for the DmesgPlugin:
143+ ` ` ` sh
144+ node-scraper gen-plugin-config --plugins DmesgPlugin
145+ ` ` `
146+
147+ This would produce the following config:
148+
149+ ` ` ` json
150+ {
151+ " global_args" : {},
152+ " plugins" : {
153+ " DmesgPlugin" : {
154+ " collection" : true,
155+ " analysis" : true,
156+ " system_interaction_level" : " INTERACTIVE" ,
157+ " data" : null,
158+ " analysis_args" : {
159+ " analysis_range_start" : null,
160+ " analysis_range_end" : null,
161+ " check_unknown_dmesg_errors" : true,
162+ " exclude_category" : null
163+ }
164+ }
165+ },
166+ " result_collators" : {}
167+ }
168+ ` ` `
169+
170+ # ## Plugin Configs
171+ A plugin JSON config should follow the structure of the plugin config model defined here.
172+ The globals field is a dictionary of global key-value pairs; values in globals will be passed to
173+ any plugin that supports the corresponding key. The plugins field should be a dictionary mapping
174+ plugin names to sub-dictionaries of plugin arguments. Lastly, the result_collators attribute is
175+ used to define result collator classes that will be run on the plugin results. By default, the CLI
176+ adds the TableSummary result collator, which prints a summary of each plugin’s results in a
177+ tabular format to the console.
178+
179+ ` ` ` json
180+ {
181+ " globals_args" : {},
182+ " plugins" : {
183+ " BiosPlugin" : {
184+ " analysis_args" : {
185+ " exp_bios_version" : " TestBios123"
186+ }
187+ },
188+ " RocmPlugin" : {
189+ " analysis_args" : {
190+ " exp_rocm_version" : " TestRocm123"
191+ }
192+ }
193+ }
194+ }
195+ ` ` `
194196
195- # ## '--plugin-configs' example
197+ 1. ** ' --plugin-configs' command **
196198A plugin config can be used to compare the system data against the config specifications:
197199` ` ` sh
198200node-scraper --plugin-configs plugin_config.json
@@ -249,3 +251,50 @@ Here is an example of a comprehensive plugin config that specifies analyzer args
249251 " desc" : " My golden config"
250252}
251253` ` `
254+
255+ 2. ** ' gen-reference-config' command**
256+ This command can be used to generate a reference config that is populated with current system
257+ configurations. Plugins that use analyzer args (where applicable) will be populated with system
258+ data.
259+ Sample command:
260+ ` ` ` sh
261+ node-scraper --gen-reference-config run-plugins BiosPlugin OsPlugin
262+
263+ ` ` `
264+ This will generate the following config:
265+ ` ` ` json
266+ {
267+ " global_args" : {},
268+ " plugins" : {
269+ " BiosPlugin" : {
270+ " analysis_args" : {
271+ " exp_bios_version" : [
272+ " M17"
273+ ],
274+ " regex_match" : false
275+ }
276+ },
277+ " OsPlugin" : {
278+ " analysis_args" : {
279+ " exp_os" : [
280+ " 8.10"
281+ ],
282+ " exact_match" : true
283+ }
284+ }
285+ },
286+ " result_collators" : {}
287+ ` ` `
288+ This config can later be used on a different platform for comparison, using the steps at # 2:
289+ ` ` ` sh
290+ node-scraper --plugin-configs reference_config.json
291+
292+ ` ` `
293+
294+ An alternate way to generate a reference config is by using log files from a previous run. The
295+ example below uses log files from ' scraper_logs_<path>/' :
296+ ` ` ` sh
297+ node-scraper gen-plugin-config --gen-reference-config-from-logs scraper_logs_< path> / --output-path custom_output_dir
298+ ` ` `
299+ This will generate a reference config that includes plugins with logged results in
300+ ' scraper_log_<path>' and save the new config to ' custom_output_dir/reference_config.json' .
0 commit comments