cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4470
Views
0
Helpful
2
Replies

How to send a "show" command using SNMP

Leo Laohoo
Hall of Fame
Hall of Fame

To all you SNMP script experts,

By using SNMP, how do I send a "show" command to a switch?

The command is:  sh proc cpu sorted | redirect tftp://<IP Address>/filename.txt

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

You could use a really nasty hack to do this.  Create a config file with the contents:

do show proc cpu sorted | redirect tftp://x.x.x.x/filename.txt

end

Then use the CISCO-CONFIG-COPY-MIB to copy this file into the device's running config.  At the moment the config is transfered, the show command should execute.  Be careful doing this as any interactive commands you put in the config snippet file will lock the running configuration.

For documentation on how to use the CONFIG-COPY-MIB, see

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_configuration_example09186a0080094aa6.shtml .

View solution in original post

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

You could use a really nasty hack to do this.  Create a config file with the contents:

do show proc cpu sorted | redirect tftp://x.x.x.x/filename.txt

end

Then use the CISCO-CONFIG-COPY-MIB to copy this file into the device's running config.  At the moment the config is transfered, the show command should execute.  Be careful doing this as any interactive commands you put in the config snippet file will lock the running configuration.

For documentation on how to use the CONFIG-COPY-MIB, see

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_configuration_example09186a0080094aa6.shtml .

Thanks for the assistance Joe.  Will look into this.