On Mon, 2007-06-25 at 14:37 -0700, Ajay Chenampara wrote: > Hi there, > I know im overlooking something here and i hope someone here will be > able to point it out... > Im writing a script to download our s/w and router configs via tftp > using snmp commands.
It helps to load the MIB "CISCO-CONFIG-COPY-MIB". Note about this script, it should poll() ccCopyEntryRowStatus.2 before read()/write(), but this this is blind faith. ~BAS -------- $ more signalIOSBackup.sh #!/usr/local/bin/bash # $Id: signalIOSBackup.sh 209 2007-06-26 17:38:25Z seklecki $ # Brian A. Seklecki - Collaborative Fusion, Inc. function usage() { echo "USAGE:" echo " $0 [Destination IP/Hostname]" } if [ ! -n "${1}" ]; then echo "Destination Radware Device Not Specified, BAILING!" usage; exit 1; fi # Options COMMUNITY=foo export MIBS=CISCO-CONFIG-COPY-MIB SNMPSET="/usr/local/bin/snmpset" SNMPOPT="-c ${COMMUNITY} -v2c " SNMPSET="${SNMPSET} ${SNMPOPT}" #FACILITY=pitbpa1 # Default New TFTP Destination Config if [ -n "${2}" ]; then TFTP_DESTINATION="$2"; else TFTP_DESTINATION=192.168.96.39; fi # first set it to CLI mode $SNMPSET ${1} ccCopyProtocol.2 i 1 \ ccCopySourceFileType.2 i 4 \ ccCopyDestFileType.2 i 1 \ ccCopyServerAddress.2 a "${TFTP_DESTINATION}" \ ccCopyFileName.2 s "${1}.txt" \ ccCopyEntryRowStatus.2 i 4 if [ $? -ne 0 ]; then echo "SNMP Signal to ${1} failed"; exit 1; fi sleep 5; $SNMPSET ${1} ccCopyEntryRowStatus.2 i 6 ------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users