05-05-2016 07:58 PM
Hi,
I'm trying to write a very basic EEM script, which sends an email when there is a route change:
event manager applet RoutingChanges
action 1.0 syslog msg "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface"
action 2.0 mail server "10.224.22.18" to "recipient" from "sender" subject "Catalyst Routing changes" body "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface" source-address 10.224.100.250
The problem is that 'action 2.0' is too long to type in. Is there any way I can break this into multiple lines?
Thanks
Solved! Go to Solution.
05-05-2016 08:52 PM
Sure. Just create a variable:
set body "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface"
action 2.0 mail ... body "$body"
05-05-2016 08:52 PM
Sure. Just create a variable:
set body "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface"
action 2.0 mail ... body "$body"
05-05-2016 09:44 PM
Thanks.
There doesn't appear to be a 'set' command. Instead, I tried this:
event manager environment body "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface"
The problem with this is that it literally emails me "$_routing_type $_routing_protocol route $_routing_network/$_routing_mask with gateway $_routing_lastgateway on interface $_routing_lastinterface"
05-05-2016 09:49 PM
Just figured out that it's now 'action set ...'
This is now working, thanks
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: