09-23-2013 04:07 AM
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
09-23-2013 07:59 AM
You need to put quotes around the CLI commands in your applet before the conversion. Then it will work.
09-23-2013 04:19 PM
Thanks Joseph
Sent from Cisco Technical Support iPad App
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