04-04-2005 03:26 AM
Has anyone managed to copy a configuration to/from an IOS based router using SNMP set commands?
I've used the Cisco document below as a guide for using "Cisco-config-copy-mib-v1smi mib". I can't get the last SNMP set command to work -
"ccCopyEntryRowStatus.<Random number> integer 4".
I get the response "Reason: (badValue) The value given has the wrong type or length." from NET-SNMP 5.2.1 and a similar error from other applications.
After each attempt to snmpset the object, the router gets an SNMP "no such name" error".
I've tried this on a 1701 and 3640 router.
Cisco document describing the process:-
http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094aa6.shtml
04-04-2005 04:00 AM
Hi,
I haven't used this for a while but i have used it from HPOpenview to routers and switches.
From my notes, i have recorded the create and go line as
nmpset -c
Although the documentation does say 4, might be worth trying 1.
I'll have a quick look at the MIB when i get a minute to see if 1 exists, if it doesn't then i am not sure how i came up with that!
HTH
Paddy
04-04-2005 04:08 AM
Hi
Thanks for your comments but I get the same probem using integer 1 as for 4.
Any other suggestions?
04-04-2005 04:46 AM
Hi,
I just tried it with success using the following syntax:
cd /tftpboot
touch router-config
chmod 777 router-config
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.2.115 integer 1
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.3.115 integer 4
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.4.115 integer 1
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.5.115 ipaddress "*.*.*.*"
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.6.115 octetstring "router-config"
snmpset -v 1 -c RW_String *.*.*.*.1.3.6.1.4.1.9.9.96.1.1.1.1.14.115 integer 1
$ ls -la route*
-rwxrwxrwx 1 pjdoyle other 1934 Apr 4 13:40 router-config
$ head router-config
!
! No configuration change since last restart
!
version 12.0
service timestamps debug uptime
service timestamps log datetime
service password-encryption
!
I initially tried it using an integer of 4 on the last bit and it didn't work, must be the SNMP version bit thats giving your problems.
Rgds
Paddy
04-04-2005 04:51 AM
Interestingly, if you try the last line using version 2, it still only works with integer 1
$ snmpset -v 2c -c RW *.*.*.* .1.3.6.1.4.1.9.9.96.1.1.1.1.14.115 intege
r 1
cisco.ciscoMgmt.ciscoConfigCopyMIB.ciscoConfigCopyMIBObjects.ccCopy.ccCopyTable.
ccCopyEntry.ccCopyEntryRowStatus.115 : INTEGER: active
$
Good Luck
Paddy
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