I currently have troubles using snmpset to get the cisco configuration from a monitoring server.
Here is what I tip:
snmpset -v2c -cvtmYdXVHfo9v38oAbtACikvV calcium \
1.3.6.1.4.1.9.9.96.1.1.1.1.2.111 integer 1 \
1.3.6.1.4.1.9.9.96.1.1.1.1.3.111 integer 4 \
1.3.6.1.4.1.9.9.96.1.1.1.1.4.111 integer 1 \
1.3.6.1.4.1.9.9.96.1.1.1.1.5.111 ipaddress 172.23.129.4 \
1.3.6.1.4.1.9.9.96.1.1.1.1.6.111 octetstring "config" \
1.3.6.1.4.1.9.9.96.1.1.1.1.14.111 integer 4
Following the documentation available at cisco_snmp_doc:
ccCopyProtocol is 1.3.6.1.4.1.9.9.96.1.1.1.1.2
ccCopySourceFileType 1.3.6.1.4.1.9.9.96.1.1.1.1.3
ccCopyDestFileType 1.3.6.1.4.1.9.9.96.1.1.1.1.4
ccCopyServerAddress 1.3.6.1.4.1.9.9.96.1.1.1.1.5
ccCopyFileName 1.3.6.1.4.1.9.9.96.1.1.1.1.6
ccCopyEntryRowStatus 1.3.6.1.4.1.9.9.96.1.1.1.1.14
The Cisco documentation indicates to specify a random integer (here, 111, as it is in the documentation, but specifying 1 does not change anything)
Here is what I get:
1.3.6.1.4.1.9.9.96.1.1.1.1.5.111: Value out of range (172.23.129.4)
1.3.6.1.4.1.9.9.96.1.1.1.1.6.111: Unknown Object Identifier \
(Sub-id not found: (top) -> config)
Obviously, I can't set the ip address of my server to the related oid. Furthermore, I can't figure out what the second error means.
Can anyone give me some advice ? Any help or clue would be deeply appreciated
Thanks a lot :)
Your initial question stated that you were trying to get the configuration from a monitoring server, but your response to petrus indicates that you want to copy the configuration to the server, and that's what your original example shows, so I assume that's what you're after.
Two things:
1 - This doesn't work for me without a . at the beginning of the numerical OIDS.
2 - It looks like the TYPE values available with your version of snmpget don't match those in the Cisco doc (it says they use the HPOV version of snmpset). Try running 'snmpset' without any parameters and see what you get; if you're using Net-SNMP there should be a section near the bottom that specifies the TYPEs available.
--
Here are the steps I've used in the past, using Net-SNMP and CISCO-CONFIG-COPY-MIB (apologies for the length):
Step 1: Configure the ccCopyEntryTable with the desired protocol (tftp=1), the source file type (runningConfig=4), the destination file type (networkFile=1), the IP address of your tftp server, and the desired filename on the tftp server. Last, set the RowStatus to "createAndGo" (4).
Numerically:
Using the text OIDs from the MIB:
You should get back something like this:
Step 2: Check the status:
Text version:
You should get back a "3", for success (check the MIB for other possible values):
Step 3: Destroy the row you created:
Text version:
You should get back something like this:
Step 4: Go verify it was actually copied over to the tftp server.
<tftp-server>
is dotted decimal.<config-file>
is a path relative to you TFTP root.Example:
Thanks a lot for your answer.
However, according to OLD-CISCO-SYS-MIB
The oid is 1.3.6.1.4.1.9.2.1.50 and the command tipped was
which returned
Did I choose the appropriate OID?
Moreover, it looks like it puts the configuration into the switch, I would like to perform the opposite transfer: from switch to server
Thanks for your help