08-31-2009 11:39 AM
Does anyone know if its possible to run a .tcl script via snmp. Would like to write a scripts to add or delete a route and it needs to be able to be run by someone with priv level 1 access or from a network manager.
08-31-2009 11:44 AM
This is not possible directly, but you could use the CISCO-CONFIG-COPY-MIB to upload a config snippet which contains:
do tclsh flash:script.tcl
end
Assuming the script is not interactive, this will execute the script. See http://www.cisco.com/en/US/tech/tk648/tk362/technologies_configuration_example09186a0080094aa6.shtml for more details on using the CONFIG-COPY-MIB.
A safer method (assuming the device supports EEM 2.4 or higher) is to use the EEM RPC system to execute EEM policies remotely. More on EEM 2.4, and EEM RPC can be found at http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6815/whitepaper_c11-492226.html . I have even written a Perl API to interface with EEM RPC which can be downloaded at http://forums.cisco.com/eforum/servlet/EEM?page=eem&fn=script&scriptId=1183 .
08-31-2009 12:27 PM
Thanks - if we used the SNMP MIB can I run that script without being in enable mode?
08-31-2009 12:35 PM
Yes, but you will need SNMP read-write credentials on the manager. That is, an SNMP SET operation is required.
08-31-2009 12:39 PM
ok thanks for your help
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: