Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any way to backup the switch configurations.

Status
Not open for further replies.

sasj0e

IS-IT--Management
Nov 6, 2002
82
Hi,
Is it possible to keep a working configuration of the switch as a backup and apply back incase the Switch crashes.
I have Cisco 4006 catalyst with Sup-II and os 7.3
Can anybody help me out on this..
Thanks,
sas
 
Kiwi CatTools will do this. I use it to keep a complete catalog of all of our 6500, 6000, 4000 and 3500 switches. It will also grab the configs of routers and PIXs.


MikeS


Find me at
"Take advantage of the enemy's unreadiness, make your way by unexpected routes, and attack unguarded spots."
Sun Tzu
 
SolarWinds has a very nifty suite of tools which you can use to backup configs/compare and upload saved configs
 
With CatOS just type 'show conf' and keep it in a text file. If you want to be more adventurous use a TFTP server to copy the configs to - type 'copy conf tftp'
With IOS, type 'show running-config' and keep it in a text file, for TFTP type 'copy running-config tftp'.

A bit easy really........
 
The following scripts which I run on linux will backup the configurations of CatOS and IOS based switches to the tftp server on the linux host using SNMP.

1) The CatOS version

#!/bin/bash
# This script uses SNMP to download the configuration of the CatOS
# switches, via tftp to the /tftpboot directory
#
# This version (see also saveconfig) operates based on
# the CISCO-STACK-MIB and applies to modules running the Catalyst
# Operating System (OS)
#
# Gavin Newman
#
# The production version of this script exists in the /home/root
# directory and is run via a cron job or as required

switches="switch1 switch2 switch3"

datestamp=`date +%Y%m%d`

oidCisco=.1.3.6.1.4.1.9.5.1.5
oidServer=$oidCisco.1.0
oidFilename=$oidCisco.2.0
oidModule=$oidCisco.3.0
oidAction=$oidCisco.4.0
community=xyzxyz

echo Downloading Cisco switch configurations $datestamp
for switch in $switches; do
echo -n $switch
snmpset $switch $community $oidServer s tftp_server_ip_address > /dev/null
snmpset $switch $community $oidFilename s $switch.config > /dev/null
snmpset $switch $community $oidModule i 1 > /dev/null
snmpset $switch $community $oidAction i 3 > /dev/null

r=$(snmpget -Ov $switch public $oidCisco.5.0)

while [ "$r" = "1" ]; do
echo -n .
sleep 1
r=$(snmpget -Ov $switch public $oidCisco.5.0)
done

case $r in
2) echo Success ;;
3) echo No response ;;
4) echo Too many retries ;;
5) echo No processes ;;
6) echo No buffers ;;
7) echo Bad checksum ;;
8) echo Bad Length ;;
9) echo Bad Flash ;;
10) echo Server Error ;;
11) echo User cancelled ;;
12) echo Wrong code ;;
13) echo File not found ;;
14) echo Invalid TFTP host ;;
15) echo Invalid TFTP module ;;
16) echo Access violation ;;
17) echo Unknown status ;;
18) echo Invalid storage device ;;
19) echo Insufficient space on storage device ;;
20) echo Invalid DRAM size ;;
*) echo Some sort of error - return code is $r ;;
esac
done

echo Download Completed



2) The IOS version


#!/bin/bash
# This script uses SNMP to download the configuration of the IOS based
# switches, via tftp to the /tftpboot directory
#
# Gavin Newman
#
# This version (see also savecat) implements CISCO-CONFIG-COPY-MIB
# and applies to modules running the Cisco IOS Release 12.0 or later
# software.
#
# The production version of this script exists in the /home/root
# directory and is run via a cron job or as required

datestamp=`date +%Y%m%d`

echo Downloading Cisco MSF module configurations $datestamp

oidCisco=.1.3.6.1.4.1.9.9.96.1.1.1.1
oidProtocol=$oidCisco.2
oidSource=$oidCisco.3
oidDest=$oidCisco.4
oidServer=$oidCisco.5
oidFilename=$oidCisco.6
oidStatus=$oidCisco.14
oidCopyState=$oidCisco.10
oidCopyFailCause=$oidCisco.13

routers="switcha switchb switchc"
community=xyzxyz

for router in $routers; do
s=$RANDOM

echo -n $router

snmpset $router $community $oidProtocol.$s i 1
snmpset $router $community $oidSource.$s i 4
snmpset $router $community $oidDest.$s i 1
snmpset $router $community $oidServer.$s a tftp_host_ip_address
snmpset $router $community $oidFilename.$s s $router.config

snmpset -Ir $router $community $oidStatus.$s i 1

r=$(snmpget -Ov $router $community $oidCopyState.$s)

sleep 1

# May be waiting for another copy to complete
while [ "$r" = "1" ]; do
echo -n w
sleep 1
r=$(snmpget -Ov $router $community $oidCopyState.$s)
done

# Wait for copy to complete
while [ "$r" = "2" ]; do
echo -n .
sleep 1
r=$(snmpget -Ov $router $community $oidCopyState.$s)
done

case $r in
3) echo Success ;;
4) err=$(snmpget -Ov $router $community $oidCopyFailCause.$s)
case $err in
1) echo Unknown reason for failure ;;
2) echo Bad file name, path or permissions ;;
3) echo Timeout. Network load or TFTP server is not responding ;;
4) echo Memory allocation failure ;;
5) echo Could not find the requested configuration ;;
*) echo Undocumented failure code $err received ;;
esac ;;
*) echo Unknown completion status $r ;;
esac
done

echo Download Completed


Hope this helps

 
Hello,

I would like to monitor my Cisco-Switch over MRTG (on Linux). I know that there is the possibility to make this under Windows OS.

What I want is to monitor the cpu and the mem. Is this possible?

(or is there any other tool with linux to make this?

thanks,
Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top