Showing results for 
Search instead for 
Did you mean: 

EEM for port secuirty


I'm very new to EEM and have created an applet that will send a email when port secuirty has been tripped and is logged in the syslog.


I'm trying to figure out how to have the applet only send one email and not continuesly send as the messages log. Also I have seen that there are variables that can be put in to the email like ports or the actual syslog message but haven't been able to to figure them out yet. Any help would be greatly appericated.


event manager environment email_server n.n.n.n
event manager environment email_from
event manager environment email_to

event manager applet Port_sec
 event syslog pattern "Security violation occurred"
 action 2 mail server "$email_server" to "$email_to" from "$email_from" subject "Port Security Has been tripped"





1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

You can use the syslog event detector parameters like occurs and period to limit the number of times the applet triggers based on the frequency of the messages.  You can also parse the syslog to pull out certain values.  I am not familiar with the full contents of this message, but something like:


action 1.0 regexp "(GigabitEthernet[0-9/]+)" $_syslog_msg match intf

action 2.0 mail server "$email_server" to "$email_to" from "$email_from" subject "Port Security Has been tripped on $intf"

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: