here is the startup guide from csico for EEM :
https://community.cisco.com/t5/networking-documents/cisco-eem-basic-overview-and-sample-configurations/ta-p/3148479
here is example of BGP EEM scrip from my notes. (this is for reference only - tweak as per requirement)
!!BGP down
event manager applet BGP_DOWN_2
event syslog pattern "neighbor IPaddress2 Down"
action 02 if $BGP eq 0
action 50 syslog msg "Setting variable equals 20 - 1 neighbor down"
action 51 set $BGP 20
action 55 end
action 60 if $BGP ne 0
action 60 syslog msg "Shuting down interfaces for neighbor - 2 links down"
action 61 set $BGP 40
action 62 cli command "enable"
action 63 cli command "conf term"
action 65 cli command "interface vlan 30"
action 66 cli command "shutdown"
action 67 cli command "interface vlan 31"
action 68 cli command "shutdown"
action 69 syslog msg "Removed comunications with Router Reflector"
action 70 end