Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this case the necessary configuration for opEvents is contained in /usr/local/omk/conf/EventActions.nmis.  There are two sections we will be concerned with; script and policy.

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.

Code Block
title/usr/local/omk/conf/EventActions.nmis
 	'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'
                },
	}

In the policy section we define a rule that matches stateful properties that contain 'BGP Peer'.  If there's a match it will fire the scripts defined above.

Code Block
title/usr/local/omk/conf/EventActions.nmis
 

 

opConfig

Testing and Verification

...