tcl script

Unanswered Question
Aug 31st, 2009
User Badges:

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Mon, 08/31/2009 - 11:44
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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 .

jschweng Mon, 08/31/2009 - 12:27
User Badges:

Thanks - if we used the SNMP MIB can I run that script without being in enable mode?

Joe Clarke Mon, 08/31/2009 - 12:35
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Yes, but you will need SNMP read-write credentials on the manager. That is, an SNMP SET operation is required.

Actions

This Discussion