03-31-2020 05:08 PM
I'd like to use this config for EEM in the Nexus 5K. The Nexus only takes the first event syslog occurs statement so I don't understand why it's losing the 2nd statement. See below for sh run eem. Nexus 5548 version 7.0(7)N1(1). Am I violating a syntax rule?
no event manager applet EM-CHECK-FEX
event manager applet EM-CHECK-FEX
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_OFFLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 2.0 snmp-trap strdata "$_syslog_msg"
Nexus5K(config-applet)# do sh run eem
!Command: show running-config eem
!Time: Tue Mar 31 16:59:18 2020
version 7.0(7)N1(1)
event manager applet EM-CHECK-FEX
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
action 2.0 snmp-trap strdata "$_syslog_msg"
Solved! Go to Solution.
03-31-2020 06:49 PM - edited 03-31-2020 07:16 PM
Pattyj,
In your configuration:
no event manager applet EM-CHECK-FEX
event manager applet EM-CHECK-FEX
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_OFFLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 2.0 snmp-trap strdata "$_syslog_msg"
The event manager applet will overwrite the first statement as there can be only one event statement per applet.
See the Embedded Event Manager Configuration Guide - here.
In order to perform this you would have to do the following:
no event manager applet EM-CHECK-FEX
event manager applet EM-CHECK-FEX-OFFLINE
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_OFFLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
exit
event manager applet EM-CHECK-FEX-ONLINE
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
exit
However, keep in mind that the event syslog pattern can match on any part of the pattern. So for example if you wanted it to match any state such as offline or online you could simply match the pattern on everything except for offline or online.
For example:
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX"
Another thing to keep in mind is that in order to send traps using the event manager you must also configure the following command:
snmp-server enable traps event-manager
Hope this helps!
03-31-2020 06:49 PM - edited 03-31-2020 07:16 PM
Pattyj,
In your configuration:
no event manager applet EM-CHECK-FEX
event manager applet EM-CHECK-FEX
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_OFFLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 2.0 snmp-trap strdata "$_syslog_msg"
The event manager applet will overwrite the first statement as there can be only one event statement per applet.
See the Embedded Event Manager Configuration Guide - here.
In order to perform this you would have to do the following:
no event manager applet EM-CHECK-FEX
event manager applet EM-CHECK-FEX-OFFLINE
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_OFFLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
exit
event manager applet EM-CHECK-FEX-ONLINE
description "Checks FEX for availability because no trap would be sent"
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX_ONLINE"
action 1.0 snmp-trap strdata "$_syslog_msg"
exit
However, keep in mind that the event syslog pattern can match on any part of the pattern. So for example if you wanted it to match any state such as offline or online you could simply match the pattern on everything except for offline or online.
For example:
event syslog occurs 1 pattern "FEX-2-NOHMS_ENV_FEX"
Another thing to keep in mind is that in order to send traps using the event manager you must also configure the following command:
snmp-server enable traps event-manager
Hope this helps!
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