#!/bin/sh
#
#
#    Copyright (c) 1996-2008 Brocade Communications Systems, Inc.
#    All rights reserved.
#
#    File name:   mapsInfo.sh
#    Desc: dumps supportInfo for MAPS

standby=no;
# set standby flag
/fabos/cliexec/hashow | /bin/grep Local | /bin/grep Standby > /dev/null 2>&1
if [ $? -eq 0 ]; then
	standby=yes;
fi

start_dump() {

	ORG_PATH=`echo $PATH`	
	export PATH=/fabos/link_bin:/bin:/usr/bin:/sbin:/usr/sbin:/fabos/link_abin:/fabos/link_sbin:/fabos/link_rbin:/fabos/factory:/fabos/xtool:.:/

	#Dump WEBD Info
	/bin/echo "========WEBD_SUPPORT_DUMP========================"
	/bin/echo ""
	/fabos/libexec/webdsupportshow
  	/bin/echo "========WEBD_SUPPORT_DUMP========================="
	/bin/echo ""

	#Dump SNMPD Info
	/bin/echo "========SNMPD_SUPPORT_DUMP========================"
	if [ $standby = no ]
		then
			/bin/echo ""
			/fabos/libexec/snmpdsupportshow
			/bin/echo ""
	fi	
	if [ -f "/tmp/snmp_config.txt" ]
		then
			/bin/echo "--SNMP_FWDL_ERROR_CONFIG ----------------------"
			/bin/cat "/tmp/snmp_config.txt"
	fi
	/bin/echo "========SNMPD_SUPPORT_DUMP========================="

	#Dump RPCD Info
	/bin/echo "========RPCD_SUPPORT_DUMP========================"
	/bin/echo ""
#	/fabos/libexec/rpcdsupportshow
  	/bin/echo "========RPCD_SUPPORT_DUMP========================="
	/bin/echo ""
	
	#Dump CALD Info
	/bin/echo "========CALD_SUPPORT_DUMP========================"
	/bin/echo ""
	/fabos/libexec/caldsupportshow
	/bin/echo "========CALD_SUPPORT_DUMP========================"
	/bin/echo ""

	#Dump RPC Connections Info
	/bin/echo "=======RPC_CONNECTIONS_INFO======================"
    /bin/echo ""
    netstat -an | grep 897 
    /bin/echo "=======RPC_CONNECTIONS_INFO======================"
    /bin/echo ""

	export PATH=$ORG_PATH
}

start_dump
