cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Cisco Community Designated VIP Class of 2020

4814
Views
5
Helpful
4
Replies
dal Participant
Participant

Copy config out from switch via SNMP - fails

Hi.

I have lost contact with one of my switches due to error in an vty ACL.

As I can read from other posts on this forum, it should be possile to read and write the running-config into/onto the switch using SNMP.
As can be read here: https://supportforums.cisco.com/document/10046/how-copy-configuration-files-and-cisco-ios-routers-use-snmp

But I get an error:

Here is what I'm running:

snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.2.52 -tp:int -val:1 - Telling that TFTP shall be used
snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.3.52 -tp:int -val:4 - Source file = running-config
snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.4.52 -tp:int -val:1 - Destination file = network file
snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.5.52 -tp:ip -val:172.20.225.55 - IP to TFTP-server
snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.6.52 -tp:str -val:"filename"

I get an OK on all of the above. But when I try to execute the file copy with this line:
snmpset -v:2c -c:private -r:1.1.1.1 -o:..1.3.6.1.4.1.9.9.96.1.1.1.1.14.52 -tp:int -val:4 - Copies the file to TFTP

It fails with this error message:

%Failed to set value to SNMP variable. Inconsistent Value (inconsistentValue(12))

Any ideas what could be wrong?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Engager

Hi,

Hi,

snmpset -v:2c -c:private -r:1.1.1.1 -o:..1.3.6.1.4.1.9.9.96.1.1.1.1.14.52 -tp:int -val:4

Can you try to set this value to 1 (ccCopyEntryRowStatus = active)?

Maybe you need to set it to 6 first (ccCopyEntryRowStatus = destroy) and repeat the whole procedure. You should always destroy the session at the end.

https://supportforums.cisco.com/discussion/11813936/snmp-tftp-config-files

HTH
Rolf

View solution in original post

4 REPLIES 4
Engager

Hi,

Hi,

snmpset -v:2c -c:private -r:1.1.1.1 -o:..1.3.6.1.4.1.9.9.96.1.1.1.1.14.52 -tp:int -val:4

Can you try to set this value to 1 (ccCopyEntryRowStatus = active)?

Maybe you need to set it to 6 first (ccCopyEntryRowStatus = destroy) and repeat the whole procedure. You should always destroy the session at the end.

https://supportforums.cisco.com/discussion/11813936/snmp-tftp-config-files

HTH
Rolf

View solution in original post

Highlighted
dal Participant
Participant

Excellent, that did the trick

Excellent, that did the trick!

So, on to the next question: If I want to copy the file from TFTP to running-config, I can just reverse these two lines:

snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.3.52 -tp:int -val:4 - Source file = running-config
snmpset -v:2c -c:private -r:1.1.1.1 -o:.1.3.6.1.4.1.9.9.96.1.1.1.1.4.52 -tp:int -val:1 - Destination file = network file

?

Thanks again

Engager

You're welcome.

You're welcome.

So, on to the next question: If I want to copy the file from TFTP to running-config, I can just reverse these two lines:

Yes.

dal Participant
Participant

Tested, and it works like a

Tested, and it works like a charm.

Thanks again.

CreatePlease to create content
Content for Community-Ad