Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

automate show command

So we have a very strange connectivity issue. To troubleshoot down i would like to have the outputs of "show arp" and the output of "show mac-address-table" before and after this connectivity issue happens. The connectivity issue doesnt last long so it is hard to get into the 2 core L3 switches and get this info in a quick enough time. Is there a way to automate this process so say the switch will send the output of those to commands to a tftp server or a syslog etc every say 10 minutes or something

Hall of Fame Super Silver

Re: automate show command

Hello Mike,

you need to use a specialized scripting language like TCL/TK with Expect that allows to automate login to device to send commands and to get output back.


Hope to help


New Member

Re: automate show command

New Member

Re: automate show command

You could try to automate this with an EEM Applet. Show arp and show mac-address-table are executed every 10 minutes with the below script and the output is stored in your log buffer of your router. If you have syslog server setup then that output can be exported.

However, the caveat is that your log buffer might get filled quickly.

event manager applet test

event timer watchdog time 600

action 1.0 cli command "show arp"

action 2.0 syslog msg "$_cli_result"

action 3.0 cli command "show mac-address-table"

action 4.0 syslog msg "$_cli_result"

New Member

Re: automate show command

Thanks guys. I will give your ideas a shot when i have some time.

CreatePlease to create content