09-06-2024 06:30 PM
Hello,
Supposedly 2960x support eem past 15.2.(4) and currently on 15.2.7. Any pointers how to enable the Trap? Shows disable.
Basically trying to have port shut/noshut on certain time. but when I check policy registered they show but off. Thank you in advance.
* 1 28 WS-C2960X-24PSQ-L 15.2(7)E9 C2960X-UNIVERSALK9-M
event manager applet Shutdown_Port
event timer cron cron-entry "45 23 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "shutdown"
action 1.4 cli command "end"
event manager applet Enable_Port
event timer cron cron-entry "45 5 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "no shutdown"
action 1.4 cli command "end"
09-09-2024 12:57 AM
Hello @enable.15
Please provide us the output of that command:
#show event manager version
Also, see debugs commands here:
10-01-2024 06:49 AM - edited 10-01-2024 06:57 AM
Hi M02@rt37 sorry for late been busy.
Here is the output:
show event manager version
Embedded Event Manager Version 4.00
Component Versions:
eem: (rel9)1.2.22
eem-gold: (rel1)1.0.2
eem-call-home: (rel2)1.0.4
Event Detectors:
Name Version Node Type
application 01.00 node0/0 RP
identity 01.00 node0/0 RP
mat 01.00 node0/0 RP
neighbor-discovery 01.00 node0/0 RP
generic 01.00 node0/0 RP
routing 03.00 node0/0 RP
syslog 01.00 node0/0 RP
cli 01.00 node0/0 RP
config 01.00 node0/0 RP
counter 01.00 node0/0 RP
crash 01.00 node0/0 RP
ds 01.00 node0/0 RP
env 01.00 node0/0 RP
gold 01.00 node0/0 RP
interface 01.00 node0/0 RP
ioswdsysmon 01.00 node0/0 RP
nf 01.00 node0/0 RP
none 01.00 node0/0 RP
oir 01.00 node0/0 RP
snmp 01.00 node0/0 RP
snmp-object 01.00 node0/0 RP
snmp-notification 01.00 node0/0 RP
test 01.00 node0/0 RP
timer 01.00 node0/0 RP
Now, interesting part. I had power outage and switch rebooted.
Same day on the dot when eem should trigger got this:
Sep 30 11:45:00.063: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Enable_Port)
Oct 1 05:45:00.078: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Shutdown_Port)
Not sure why its reversed, pretty sure its my event timer cron that I need to look at - but it seems like reboot did trigger eem to start working
Corrent me if I'm wrong but this should shutdown at 11:45
event timer cron cron-entry "45 23 * * *"
And this recover at 5:45 AM
event timer cron cron-entry "45 5 * * *"
So not sure why the eem is reversed with the logic:
event manager applet Shutdown_Port event timer cron cron-entry "45 23 * * *" action 1.0 cli command "enable" action 1.1 cli command "config t" action 1.2 cli command "interface GigabitEthernet0/7" action 1.3 cli command "shutdown" action 1.4 cli command "end" event manager applet Enable_Port event timer cron cron-entry "45 5 * * *" action 1.0 cli command "enable" action 1.1 cli command "config t" action 1.2 cli command "interface GigabitEthernet0/7" action 1.3 cli command "no shutdown" action 1.4 cli command "end"
10-01-2024 07:04 AM
Thanks @enable.15
Check your switch’s current time and time zone to ensure it aligns with your intended cron schedule.
10-01-2024 07:13 AM
Time is good- EDIT, time changed it seems. Like I said, The logic is reversed on the script as per log. So instead of Shutdown_Port at 11:45 we have Enable_port and vice verse. Confirmed the cron time script and its correct so don't know why it would be doing reverse.
Sep 30 11:45:00.063: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Enable_Port) Oct 1 05:45:00.078: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Shutdown_Port)
10-01-2024 07:25 AM
Fixed the time, I'll see if the eem trigers today
show event manager policy registered
No. Class Type Event Type Trap Time Registered Name
1 applet user timer cron Off Tue Oct 1 09:21:17 2024 Shutdown_Port
cron entry {45 23 * * *}
maxrun 20.000
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "shutdown"
action 1.4 cli command "end"
action 1.5 syslog msg "Shut down GigabitEthernet0/7 at 23:45"
2 applet user timer cron Off Tue Oct 1 09:21:41 2024 Enable_Port
cron entry {45 5 * * *}
maxrun 20.000
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "no shutdown"
action 1.4 cli command "end"
action 1.5 syslog msg "Enabled GigabitEthernet0/7 at 05:45"
sh clock
09:23:37.142 CST Tue Oct 1 2024
10-01-2024 07:51 AM - edited 10-01-2024 07:52 AM
You could try removing and then re-creating the applets to ensure they are properly registered, to avoid any confusion caused by misalignment or corruption after the reboot...
After re-registering, you can test the execution of both applets manually by adjusting the cron time temporarily to run shortly after the current time to observe if the correct commands (shut or no shut) are issued.
10-02-2024 08:12 AM
M02@rt37so it seems like the eem works because wifi was lost at the giving time and recovered in the morning but logging is still confusing - not sure why I'm seeing reversed even though in real it works correctly look:
Here it tells us it shuts down the port at 5:45 in the morning (which should be the opposite):
Oct 2 05:45:00.175: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Shutdown_Port)
Oct 2 05:45:00.178: %HA_EM-6-LOG: Shutdown_Port: Shut down GigabitEthernet0/7 at 23:45
Oct 2 05:45:02.157: %LINK-5-CHANGED: Interface GigabitEthernet0/7, changed state to administratively down
Oct 2 05:45:03.160: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/7, changed state to down
And we can see the reverse happening at 11:45 (maybe it should be 23:45?!) But again makes no sense from log since physically I saw it going down at night and recovered in the morning.
Oct 2 11:45:00.070: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:Enable_Port)
Oct 2 11:45:00.077: %HA_EM-6-LOG: Enable_Port: Enabled GigabitEthernet0/7 at 05:45
Oct 2 11:45:01.073: %ILPOWER-7-DETECT: Interface Gi0/7: Power Device detected: IEEE PD
Oct 2 11:45:02.045: %ILPOWER-5-POWER_GRANTED: Interface Gi0/7: Power granted
Time is correct on the switch
sh clock
10:08:52.945 CST Wed Oct 2 2024
crons do appear to be correct:
11:45 pm
event timer cron cron-entry "45 23 * * *"
5:45AM
event timer cron cron-entry "45 5 * * *"
Any ideas?!
10-02-2024 08:15 AM
Look I just did a quick shutdown to look at the log timing:
Oct 2 16:13:29.563: %LINK-5-CHANGED: Interface GigabitEthernet0/14, changed state to administratively down
Oct 2 16:13:30.566: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/14, changed state to down
where it should be at 10:14AM, so what time source is the log using?! interesting
10-02-2024 08:29 AM
service timestamps log datetime localtime show-timezone
fixes it:
Oct 2 16:16:17.359: %SYS-5-CONFIG_I: Configured from console by bmoadmin on vty0 (192.168.128.159)
Oct 2 10:28:27 CST: %LINK-5-CHANGED: Interface GigabitEthernet0/14, changed state to administratively down
Oct 2 10:28:28 CST: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/14, changed state to down
core-sw(config-if)#
09-09-2024 01:01 AM
Where you use trap
MHM
10-01-2024 06:50 AM
I'm sorry could you elaborate?! I don't believe so. This is the only config I wrote, thanks.
event manager applet Shutdown_Port
event timer cron cron-entry "45 23 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "shutdown"
action 1.4 cli command "end"
event manager applet Enable_Port
event timer cron cron-entry "45 5 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "config t"
action 1.2 cli command "interface GigabitEthernet0/7"
action 1.3 cli command "no shutdown"
action 1.4 cli command "end"
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