...
Let's have a look at the script section first. For this example we want to ping the node that reported the problem, the BGP peer it's having an issue with, and leverage opConfig to gather related command output. Notice the arguments passed to opconfig-cli.pl, there is a command set name; IOS_TS_BGP. In the opConfig step we'll define what these specific router commands are.
Code Block | ||
---|---|---|
| ||
'script' => { 'ping_node' => { arguments => '-c 5 node.host', exec => '/bin/ping', output => 'save' }, 'ping_neighbor' => { arguments => '-c 5 event.element', exec => '/bin/ping', output => 'save' }, 'troubleshoot_bgp' => { arguments => 'act=run_command_sets names=IOS_TS_BGP nodes=node.name print_command_output=true mthread=false debug=0 quiet=1', exec => '/usr/local/omk/bin/opconfig-cli.pl', output => 'save' }, } |
...
Code Block | ||
---|---|---|
| ||
'policy' => { '10' => { IF => 'event.any', THEN => { '10' => { IF => 'event.stateful =~ "BGP Peer"', THEN => 'priority(8) AND script.ping_node() AND script.ping_neighbor() AND script.troubleshoot_bgp()', BREAK => 'false' }, }, } |
...
opConfig
Testing and Verification
...