09-09-2022 07:19 AM
I have searching something useful to do this, but I haven´t funded something useful. I wanted to use "event timer feature" (with EEM) like IOS but seems like it does not exist in NXOS versions. Could you help me with some ideas?
Version 10.1(1) Nexus
93108TC-EX
Thank you!
Solved! Go to Solution.
09-13-2022 04:17 AM - edited 09-13-2022 04:18 AM
I tried this, but it didn't run. Sorry it's not much help, but it might just point you in the right direction:
event manager applet SHUTPORTs
action 0001 cli command "enable"
action 0002 cli command "configure terminal"
action 0003 cli command "interface Eth1/10"
action 0004 cli command "descr EEM-Script" <- change to shutdown
action 0005 cli command "end"
action 0006 syslog msg SHUTPORTs EEM has executed
exit
!
feature scheduler
scheduler job name JOB-SHUTPORTs
event manager run SHUTPORTs
exit
scheduler schedule name SCH-SHUTPORTs
job name JOB-SHUTPORTs
time start 2022:09:13:22:00
exit
show scheduler schedule
09-11-2022 11:49 AM
Hi @jair6a
I see the option to use timer with EEM available for both N7k and N9K:
event timer {absolute time time name name | countdown time time name name | cron cronentry string | tag tag | watchdog time time name name}
If the feature is missing you probably need to upgrade your NXOS version.
Here is the config guide:
Take care,
Sergiu
09-12-2022 03:52 PM
Thank you for your reply. In fact, I found the configuration guide for the specific version (10.1):
and I saw the option in the guide as you mentioned before, but in the cli of my switches it isn´t.
N9k(config)#
N9k(config)#
N9k(config)# event manager applet SHUTPORTs
N9k(config-applet)#
N9k(config-applet)#
N9k(config-applet)#
N9k(config-applet)# event timer ?
^
% Invalid command at '^' marker.
N9k(config-applet)# event timer
^
% Invalid command at '^' marker.
N9k(config-applet)#
N9k(config-applet)#
N9k(config-applet)# event ?
cli Create a cli event specification
counter Create a counter event
fanabsent Create fanabsent event specification
fanbad Create fanbad event specification
fib FIB related event
memory Create memory thresholds event specification
module Create a 'module' event specification
module-failure Create a 'module-failure' event specification
oir Create Online-Insertion-Removal event specification
policy-default Use the event in the system policy being overridden
poweroverbudget Create poweroverbudget event specification
snmp Create a 'snmp' event specification.
snmp-notification Create a 'snmp-notification' event specification.
storm-control Create a storm control event specification
syslog Create a syslog event specification
sysmgr System manager related events
temperature Create temperature event specification
test Create a 'test' event specification
track Create a 'track' event specification
N9k(config-applet)# event
^
% Incomplete command at '^' marker.
N9k(config-applet)#
09-13-2022 03:45 AM
Could you write it as a Python script and use the nx-os scheduler?
An example is shown at the end of this page:
09-13-2022 04:17 AM - edited 09-13-2022 04:18 AM
I tried this, but it didn't run. Sorry it's not much help, but it might just point you in the right direction:
event manager applet SHUTPORTs
action 0001 cli command "enable"
action 0002 cli command "configure terminal"
action 0003 cli command "interface Eth1/10"
action 0004 cli command "descr EEM-Script" <- change to shutdown
action 0005 cli command "end"
action 0006 syslog msg SHUTPORTs EEM has executed
exit
!
feature scheduler
scheduler job name JOB-SHUTPORTs
event manager run SHUTPORTs
exit
scheduler schedule name SCH-SHUTPORTs
job name JOB-SHUTPORTs
time start 2022:09:13:22:00
exit
show scheduler schedule
09-13-2022 11:35 AM
You´re right. I tried with scheduler feature and it´s so easy!
I tried next:
scheduler job name SHUTPORT
configure
interface loopback0
shutdown
end-job
scheduler schedule name WEEKENDs
job name SHUTPORT
time start 2022:09:13:18:26 repeat 0:24:0
And the result was the following:
N9k# show clock
Time source is NTP
18:24:33.693 UTC Tue Sep 13 2022
N9k#
N9k#
N9k#
N9k# show ip int br
IP Interface Status for VRF "default"(1)
Interface IP Address Interface Status
Lo0 55.55.55.55 protocol-up/link-up/admin-up
Eth2/1 192.168.1.2 protocol-up/link-up/admin-up
N9k#
N9k# show clock
Time source is NTP
18:26:32.804 UTC Tue Sep 13 2022
N9k#
N9k#
N9k#
N9k# show clock
Time source is NTP
18:27:14.614 UTC Tue Sep 13 2022
N9k#
N9k# show clock
Time source is NTP
18:27:16.583 UTC Tue Sep 13 2022
N9k#
N9k#
N9k# show ip int br
IP Interface Status for VRF "default"(1)
Interface IP Address Interface Status
Lo0 55.55.55.55 protocol-down/link-down/admin-down
Eth2/1 192.168.1.2 protocol-up/link-up/admin-up
N9k#
N9k#
N9k#
Thank you for your help!
09-13-2022 02:34 PM
Thanks for posting back. Good to see that all the config can be handled directly under the scheduler job section without needing the EEM applet.
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