cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1207
Views
5
Helpful
1
Replies

EEM for port secuirty

jamescox3
Level 1
Level 1

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 test@test.com
event manager environment email_to test@test.com


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"

 

 

Thanks

 

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"