cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
280
Views
0
Helpful
1
Replies

Export show command to SCP server

Hello folks.
How could I send output from the

show

command directly to an SCP server? Currently the

redirect and tee

commands do not support this type of export.

Therefore, I am asking the community for help.

1 Accepted Solution

Accepted Solutions

Hello.
After a few tries, I got a satisfactory output.

To be successful I had to break the export into three steps.

1 - Create an initial fake file in flash with the same name as the daily routines

show macsec interface TenGigabitEthernet 1/1/1 | redirect flash:MACSEC-1.txt

2 and 3 - Create the daily routine. First, the routine will send the file to flash and only then send it to the remote server.


event manager applet MacSec authorization bypass
description "Envio de status de interface MacSec ao servidor de backup"
event timer cron cron-entry "30 18 * * *" maxrun 40
action 001 cli command "enable"
action 002 cli command "term lenght 0"
action 003 syslog msg "Exportando status de interface"
action 004 cli command "show macsec interface TenGigabitEthernet 1/1/1 | redirect flash:MACSEC-1.txt" pattern "confirm"
action 005 cli command "y"
action 006 cli command "copy flash:interface-status.txt scp:" pattern "Address"
action 007 cli command "enter ip here" pattern "username"
action 008 cli command "enter username here" pattern "filename"
action 009 cli command "MACSEC-1.txt" pattern "Password"
action 010 cli command "enter your password here"

View solution in original post

1 Reply 1

Hello.
After a few tries, I got a satisfactory output.

To be successful I had to break the export into three steps.

1 - Create an initial fake file in flash with the same name as the daily routines

show macsec interface TenGigabitEthernet 1/1/1 | redirect flash:MACSEC-1.txt

2 and 3 - Create the daily routine. First, the routine will send the file to flash and only then send it to the remote server.


event manager applet MacSec authorization bypass
description "Envio de status de interface MacSec ao servidor de backup"
event timer cron cron-entry "30 18 * * *" maxrun 40
action 001 cli command "enable"
action 002 cli command "term lenght 0"
action 003 syslog msg "Exportando status de interface"
action 004 cli command "show macsec interface TenGigabitEthernet 1/1/1 | redirect flash:MACSEC-1.txt" pattern "confirm"
action 005 cli command "y"
action 006 cli command "copy flash:interface-status.txt scp:" pattern "Address"
action 007 cli command "enter ip here" pattern "username"
action 008 cli command "enter username here" pattern "filename"
action 009 cli command "MACSEC-1.txt" pattern "Password"
action 010 cli command "enter your password here"
Review Cisco Networking for a $25 gift card