08-02-2012 02:00 PM
I have just inherited a clutch of SGE2010P for connecting VOIP and POE devices.
So far they have given me horrible flashbacks to cisco 1900 vt100 configuration screens.
I'm looking for some plausible automated way of saving the running configs using CISCO-CONFIG-COPY-MIB, perl, tcl, or whatever else might work.
I will appreciate any insight anyone may have.
Thanks.
04-16-2015 01:35 PM
this should get you started.
#!/bin/bash
host=$1
string='YourSNMPStringHere'
mib=/usr/share/snmp/mibs/CISCOSBcopy.mib
case $2 in
start | startup | startup_config )
rlCopySourceFileType="3" #3 for startup config, 2 for running config
filename=$host\_$(date +%b.%d.%Y)_startup_config.txt
;;
run | running | running_config )
rlCopySourceFileType="2" #3 for startup config, 2 for running config
filename=$host\_$(date +%b.%d.%Y)_running_config.txt
;;
* | "" | -h | --help | usage | --usage )
echo "you must specify 2 parameters, host and config"
echo ""
echo "host would be the name of a switch that is to be backed up, sg300 or sg500"
echo "config would be the name of the config to be backed up, running_config or startup_config"
exit
;;
esac
rlCopyRowStatus="4" #create and go
rlCopySourceLocation="1" #local
rlCopySourceIpAddress="0.0.0.0"
rlCopySourceUnitNumber="1" #unit number in stack
rlCopySourceFileName="" #blank
rlCopyDestinationLocation="3" #tftp
rlCopyDestinationIpAddress="192.168.1.254" #tftp server ip
rlCopyDestinationUnitNumber="1" #unit number in stack
rlCopyDestinationFileName=$filename
backup (){
snmpset -v2c -c $string -m +/usr/share/snmp/mibs/CISCOSBcopy.mib $host \
rlCopyRowStatus.0 i $rlCopyRowStatus \
rlCopySourceLocation.0 i $rlCopySourceLocation \
rlCopySourceIpAddress.0 a $rlCopySourceIpAddress \
rlCopySourceUnitNumber.0 i $rlCopySourceUnitNumber \
rlCopySourceFileType.0 i $rlCopySourceFileType \
rlCopyDestinationLocation.0 i $rlCopyDestinationLocation \
rlCopyDestinationIpAddress.0 a $rlCopyDestinationIpAddress \
rlCopyDestinationUnitNumber.0 i $rlCopyDestinationUnitNumber \
rlCopyDestinationFileName.0 s $rlCopyDestinationFileName
}
backup
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide