#! /pkg/bin/ksh
# ---------------------------------------------------------------------
# isis_techsupport - IS-IS show tech-support script
#
# March 2004, michael shiplett
#
# Copyright (c) 2004-2008, 2010, 2012-2014 by cisco Systems, Inc.
# All rights reserved.
#--------------------------------------------------------------------

### Required by show_tech
. /pkg/bin/show_tech_main_fragment

### List the sets of show commands to run. Each set must finish with
### an empty string. Note that it is important to use single quotes
### rather than double quotes for the strings containing your commands.

## Command set
cmd_index=0

command1[$cmd_index]='show inst which comp clns-isis'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show running-config router isis'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis all'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis nsr statistics'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis nsr status infra'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis nsr interface'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis nsr adjacency'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis standby nsr statistics'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis standby nsr status infra'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis standby nsr interface'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis standby nsr adjacency'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis trace all location all'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show isis uber-verifier trace all location all'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show clns trace'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show segment-routing trace'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show ipv4 int brief'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show ipv6 int brief'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show imds interface all'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show lpts bindings client-id clnl brief'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show route afi-all safi-all topology all isis'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show route afi-all safi-all topology all'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show clns statistics'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]='show interfaces accounting'
cmd_index=$((cmd_index + 1))

command1[$cmd_index]=''

#
# Command set 2 are run on all nodes
#
cmd_index=0
command2[$cmd_index]='show netio clients location $location'
cmd_index=$((cmd_index + 1))

command2[$cmd_index]='show clns pcb location $location'
cmd_index=$((cmd_index + 1))

command2[$cmd_index]='show lpts pifib entry type isis location $location'
cmd_index=$((cmd_index + 1))

command2[$cmd_index]=''

### Variable initialization
# the component for which show tech-support is running
component=isis

# the diagnostic command set to use
command_set=1

# the all nodes command set
all_command_set=2

### Required argument parsing
### All local options must be upper-case.
while [ $# -gt 0 ]; do
  case "$1" in
      *) default_parser_function "$@"; shift $# ;;
  esac
done


### display - run the show commands
### MUST be named display.
### Called by show_tech_file_fragment().
display() {
     # Print the output heading 
     print_main_heading "show tech-support $component"

     run_commands $command_set

     run_commands_on_all_nodes $all_command_set

     # Print the closing heading. 
     print_main_heading "show tech-support $component complete"
}


### This mandatory bit calls display() and handles output redirection.
. /pkg/bin/show_tech_file_fragment
