07-25-2005 09:23 AM
Greetings.
I'm trying to use snmpset commands to perform a tftp action whereby I download a copy of the router's config to my tftp server. I've created a linux shell script to do this, and it all works except for the last line where I kick off the tftp action. The target is a Cisco 3640 running 12.2.28a IP Plus code, and I've verified that this code supports the desired actions.
Below is the script:
-----
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.2.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.3.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.4.666 i 3
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.6.666 s warehouse.txt
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.5.666 a 10.30.104.95
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 4
----------------------------------------
when the last line runs, I get the following error message:
Error in packet.
Reason: inconsistentValue (The set value is illegal or unsupported in some way)
Failed object: SNMPv2-SMI::enterprises.9.9.96.1.1.1.1.14.666
Can anyone please guide me to an answer? This is my first shot at doing this, our CiscoWorks won't be online for several months and I really need to get this working.
Thanks, Jeff
Solved! Go to Solution.
07-25-2005 09:43 AM
If you are issuing the commands on separate lines, you need to create (and wait) the row first and then activate it.
In other words, try these:
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 5
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.2.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.3.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.4.666 i 3
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.6.666 s warehouse.txt
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.5.666 a 10.30.104.95
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 1
07-25-2005 09:43 AM
If you are issuing the commands on separate lines, you need to create (and wait) the row first and then activate it.
In other words, try these:
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 5
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.2.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.3.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.4.666 i 3
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.6.666 s warehouse.txt
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.5.666 a 10.30.104.95
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.37 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 1
07-26-2005 03:35 AM
your changes got me _very_ close, close enough in fact that I saw what else I was doing wrong. The code below works perfectly to pull the running config. I had to change the 1.1.3 option to 4 so it'd pull the running config.
--------------------------
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 5
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.2.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.3.666 i 4
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.4.666 i 1
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.5.666 a 10.30.104.95
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.6.666 s warehouse.txt
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 1
/usr/bin/snmpget -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.10.666
/usr/bin/snmpset -c mycommunity -v 2c 10.255.3.1 1.3.6.1.4.1.9.9.96.1.1.1.1.14.666 i 6
-------------------------------
Thanks for the help, I thought I'd share my completed shell script with you so that others may benefit from our work and your great help.
-Jeff
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