cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1350
Views
0
Helpful
3
Replies

NXOS - Automate send logging history to FTP Server

Hi all.

I have a Nexus 9300 and Catalyst 9500. I am trying to send entries of log to a FTP Server daily. Can you help me to accomplish this? Thank you.

Best regards,

3 Replies 3

marce1000
VIP
VIP

 

          - Why don't you just use a syslog server to collect and archive logs ?

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

balaji.bandi
Hall of Fame
Hall of Fame

best is syslog, so you have all the logs in real time.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello,

 

the EEM script below would send the entire content of the log file to an FTP server daily at midnight, and create a file on the FTP server with the device name followed by a timestamp. It also clears the log and sends a syslog message indicating that the file was written to the FTP server successfully.

 

Not sure if the syntax is the same on NX-OS...

 

event manager environment _event_pub_sec
event manager applet LOG_TO_FTP
description Log content to FTP server
event timer cron cron-entry "0 0 * * *" maxrun 9999999
action 1.0 info type routername
action 2.0 cli command "enable"
action 3.0 cli command "show log | append ftp://ftp-server/$_info_routername-log_$_event_pub_sec"
action 4.0 cli command "clear log" pattern "confirm"
action 5.0 cli command "y"
action 6.0 syslog priority informational msg "Log content successfully written to FTP server"

Review Cisco Networking for a $25 gift card