02-28-2021 09:03 PM - edited 02-28-2021 09:21 PM
Hi, guys,
If any configuration sample ( EEM, TCL..or what else ) of the Cisco CLI script to export the result:
1. the script task is triggered by some conditions, such as "80% interface traffic utilization" is reached
2. execute and export the result, for example, " show flow monitor NETFLOW-1 cache format table"
3. export the results to a server (syslog server, or any server ); or save the results locally in Cisco router/switches for later viewing
Many many thanks in advance
Solved! Go to Solution.
03-01-2021 04:06 AM
Hello,
below an example of an EEM script. The script would send the output of the 'show' command to a FTP server.
The crucial part is: what do you want the script to be triggered on ? In the example below, you would need to enter a syslog pattern (assuming that your netflow config does generate a syslog entry).
The script can also be triggered by an interface value (e.g. txload).
event manager environment _event_pub_sec
event manager applet FLOW_MON
description NETFLOW to FTP
event syslog pattern "pattern"
action 1.0 info type routername
action 2.0 cli command "enable"
action 3.0 cli command "show flow monitor NETFLOW-1 cache format table | 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"
03-01-2021 04:06 AM
Hello,
below an example of an EEM script. The script would send the output of the 'show' command to a FTP server.
The crucial part is: what do you want the script to be triggered on ? In the example below, you would need to enter a syslog pattern (assuming that your netflow config does generate a syslog entry).
The script can also be triggered by an interface value (e.g. txload).
event manager environment _event_pub_sec
event manager applet FLOW_MON
description NETFLOW to FTP
event syslog pattern "pattern"
action 1.0 info type routername
action 2.0 cli command "enable"
action 3.0 cli command "show flow monitor NETFLOW-1 cache format table | 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"
03-01-2021 05:49 PM
Great recommendation.
Cheers
Benson
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