cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1301
Views
5
Helpful
2
Replies

How to write the script and to export the result ?

bensonlei
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

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"

View solution in original post

2 Replies 2

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"

Great recommendation.

 

Cheers

Benson