Linux Shell Wrapper Failure Test

“Automater” Tech Tip: Linux Shell Wrapper Example

Using the command line version of the scripts inside of a Linux shell script really steps of the power of Automation Scripting.  The example shell wrapper, performs the following:

  1. Run the check_bgp_nbrs script to confirm all BGP neighbors are up
  2. Run the check_bgp_routes script to confirm all BGP attributes are what they are supposed to be
  3. Run the check_eigrp_nbrs script to confirm all EIGRP nbrs are up
  4. Run the check_eigrp_routes script to confirm all EIGRP routing metrics are what they are supposed to be
  5. Run the pinger script to confirm full network connectivity
  6. Run the tracer script to confirm traffic paths
  7. Introduce first network failure: Shutdown interface Gi 0/0/0 on router ny_rtr1
  8. Sleep a few seconds to let network converge
  9. Depending on the failure run the scripts 1 through 6 to confirm the network is doing what you wish.
  10. Turn interface Gi 0/0/0 on router ny_rtr1 backup
  11. Sleep a few seconds to let network converge
  12. Run Scripts 1 through 6 again to make sure network returned to “steady-state”
  13. Perform a second failure test which shuts down 3 of 4 links of a port channel on an ethernet switch.

Download sample file. Note, don’t forget to change Linux permissions on file to make is executable (chmod 755 filename)

How to run:

Usage:
sample_failure_test.sh <number of iterations to run>

Example:
sample_failure_test.sh