cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1579
Views
0
Helpful
2
Replies

Netflow EEM Script Question

Hello Community,

Can someone please tell me if its possible to convert netflow flow record configuration EEM to Tcl?

Will my following example work?

::cisco::eem::event_register_none

#

# This EEM tcl policy was generated by the EEM applet conversion

# utility at http://www.marcuscom.com/convert_applet/

# using the following applet:

#

# event manager applet netflow_all

# event none

# action 1.0 cli command enable

# action 2.0 cli command conf t

# action 3.0 cli command flow record FlowRecord1

# action 4.0 cli command match ipv4 protocol

# action 5.0 cli command match ipv4 tos

# action 6.0 cli command match ipv4 source address

# action 7.0 cli command match ipv4 destination address

# action 8.0 cli command match transport source-port

# action 9.0 cli command exit

# action 10.0 cli command flow monitor FlowMonitor1

# action 12.0 cli command cache timeout active 86520

# action 13.0 cli command cache entries 32768

# action 14.0 cli command record FlowRecord1

# action 15.0 cli command end

#

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

array set arr_einfo [event_reqinfo]

if [catch {cli_open} result] {

    error $result $errorInfo

} else {

    array set cli1 $result

}

if [catch {cli_exec $cli1(fd) enable} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) conf} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) flow} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) match} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) match} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) match} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) match} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) match} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) exit} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) flow} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) cache} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) cache} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) record} _cli_result] {

    error $_cli_result $errorInfo

}

if [catch {cli_exec $cli1(fd) end} _cli_result] {

    error $_cli_result $errorInfo

}

# Close open cli before exit.

catch {cli_close $cli1(fd) $cli1(tty_id)} result

Cheers

Carlton

2 Replies 2

Joe Clarke
Cisco Employee
Cisco Employee

You need to put quotes around the CLI commands in your applet before the conversion.  Then it will work.

Thanks Joseph

Sent from Cisco Technical Support iPad App

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco