...
2. Command-Set Definition (IOS_INTERFACE_INVENTORY)
Create the file under:
/usr/local/omk/conf/command_sets.d/IOS_INTERFACE_INVENTORY.json
and adds the FSM plugins to command set .
use_processing_plugins : which plugins to run during process_configuration step,
custom_table_configuration : How many table configurations are needed and their title and columns (This only works if TextFsmTable is part of use_processing_plugins)
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
"use_processing_plugins" : |
...
[ "TextFsm","TextFsmTable","TextFsmInventory","AlertTextFsmMTU" |
...
], |
...
"custom_table_configuration" : |
...
[ { "title" : "Custom Table Data 01", |
...
"labels" :[ "INTERFACE","DESCRIPTION", "BANDWIDTH", "MTU","SPEED", "PROTOCOL_STATUS"] |
...
}, |
...
{ "title" : "Custom Table Data 02", |
...
"labels" :[ "INTERFACE","DESCRIPTION"] |
...
} ], |
Example configuration:
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
{ "IOS_INTERFACE_INVENTORY" : { |
...
"active" : "true", |
...
"os_info" : { |
...
"os" : "IOS" |
...
}, |
...
"modified" : 1770074947, |
...
"scheduling_info" : { |
...
"run_local" : null, |
...
"run_commands_on_separate_connection" : "false", |
...
"attempt_timeout_recovery" : 1, |
...
"parameters_required" : null |
...
}, |
...
"parameters" : [], |
...
"purging_policy" : { |
...
"purge_older_than" : null, |
...
"keep_last" : 0, |
...
"autoprotect_first_revision" : null |
...
}, |
...
"commands" : [ |
...
{ |
...
"command" : "show interfaces", |
...
"compare_to_previous_revision" : null, |
...
"use_collection_plugin" : "", |
...
"tags" : [ |
...
"DAILY", |
...
"detect-change", |
...
"inventory", |
...
"report-change" |
...
], |
...
"use_processing_plugins" : [ |
...
"TextFsm","TextFsmTable","TextFsmInventory","AlertTextFsmMTU" |
...
], |
...
"custom_table_configuration" : [ |
...
{ |
...
"title" : "Custom Table Data 01", |
...
"labels" :[ "INTERFACE","DESCRIPTION", "BANDWIDTH", "MTU","SPEED", "PROTOCOL_STATUS"] |
...
}, |
...
{ |
...
"title" : "Custom Table Data 02", |
...
"labels" :[ "INTERFACE","DESCRIPTION"] |
...
} |
...
], |
...
"report_level_min_changes" : null, |
...
"privileged" : "false", |
...
"multipage" : "true", |
...
"active" : "true" |
...
} |
...
] |
...
} |
...
} |
3. Plugin Roles
TextFsm
· Parses raw CLI output using NTC templates
...
4. Running the Command-Set
Run using opconfig-cli:
| Code Block | ||||
|---|---|---|---|---|
| ||||
/usr/local/omk/bin/opconfig-cli.pl act=run_command_sets nodes=omk-core2 names="IOS_INTERFACE_INVENTORY" debug=9 |
Or
Create a VO Job to run command-set on selected nodes.
...