09-14-2023 11:01 AM - last edited on 09-18-2023 05:52 PM by Translator
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.
Solved! Go to Solution.
09-15-2023 04:39 AM - last edited on 09-18-2023 05:53 PM by Translator
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"
09-15-2023 04:39 AM - last edited on 09-18-2023 05:53 PM by Translator
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"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide