#!/pkg/bin/ksh
# -----------------------------------------------------------------------------
# show_tech_json_rpc - Show tech-support fast script for JSON-RPC server.
#
# March 2015, James Higgs
#
# Copyright (c) 2015 by cisco Systems, Inc.
# All rights reserved.
#------------------------------------------------------------------------------

. /pkg/bin/show_tech_main_fragment

__cardtype="unspecified"

# Parse the arguments to the script.
while [ "$#" -gt "0" ]; do
    case "$1" in
        -t) __cardtype="$2"; shift 2;;
        *)  default_parser_function "$@"; shift $#;;
    esac
done

if [ "$__cardtype" == "unspecified" ]; then
    __cardtype=`node_type`
fi

#******************************************************************************
# Show commands to be run by the show tech-support commands
#******************************************************************************

# JSON-RPC show trace command
sys_exec[1]='show json-rpc trace'
sys__ksh[1]='json_rpc_server_trace'

# General Commands
sys_exec[2]='show mda trace'
sys__ksh[2]='mda_show_ltrace'
sys_exec[3]='show sysdb trace access'
sys__ksh[3]='sysdb_show_ltrace -r -T access -i 0'
sys_exec[4]='show config history'
sys__ksh[4]='cfgmgr_show_history -s -f -n 0x5dc -t all -b'
sys_exec[5]='show running'
sys__ksh[5]='nvgen -c -l 1 -t 1 -o 1'
sys_exec[6]='show version'
sys__ksh[6]='show_version'

#******************************************************************************
# Script
#******************************************************************************

display() {
    print_main_heading "show tech-support json-rpc"

    exec_commands sys

    print_main_heading "show tech-support json-rpc complete"
}

. /pkg/bin/show_tech_file_fragment


