03-09-2023 11:23 AM - edited 03-09-2023 11:25 AM
I have the following script,
I keep getting the message " %HA_EM-6-FMPD_EEM_CONFIG: check_vlan_traffic: "end" action found outside of conditional block"
but I cant find any offending "end" statements. I am trying to understand what I am conceptually missing here.
event manager applet check_vlan_traffic
event timer watchdog time 60 maxrun 60
action 0.0 cli command "enable"
action 1.0 set vlans ""
action 2.0 cli command "show interfaces status | include Vl"
action 3.0 regexp "Vl([0-9]+)" "$_cli_result" vlan_number
action 4.0 set vlans "$vlans $vlan_number"
action 6.0 set test_count "0"
action 7.0 foreach vlan_number "in" "$vlans"
action 8.0 cli command "show interface Vlan $vlan_number | include rate"
action 9.0 regexp "([0-9]+) bps" "$_cli_result" input_rate output_rate
action 10.0 end
action 11.0 set total_rate "$((input_rate + output_rate) / 2000000)"
action 12.0 set test_count "$test_count + 1"
action 13.0 set total_traffic "$total_traffic + $total_rate"
action 14.0 if $test_count eq "3"
action 14.0 set avg_traffic "$total_traffic / 3"
action 15.0 if $avg_traffic le "5"
action 16.0 syslog msg "VLAN $vlan_number is probably not being used anymore. Average traffic: $avg_traffic Mbps."
action 18.0 set test_count "0"
action 19.0 set total_traffic "0"
action 20.0 end
action 21.0 end
Any assistance is appreciated.
03-09-2023 11:26 AM
action 10.0 end <<- I think message mention this end
03-09-2023 11:32 AM - edited 03-09-2023 11:54 AM
removing action 10 results in same issue
03-09-2023 12:44 PM
before i comment on your script, can I know the goal of this EEM ? tell us what device model and IOS Code running.
have you executed this show command - show interfaces status | include Vl <---- what output did you get?
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