09-20-2019 05:17 AM
Hi
I want to output the dhcp binding information using a krontab every 1 hour but I can't see to work out the krontab schedule for hourly or the krontab won't do an hourly output.
This is the command that I've got and it works but I want it to run every hour
show ip dhcp binding | redirect tftp://IPAddress/_dhcp_binding.txt
Can anyone tell me how I can schedule it every hour or let me know an alternative suggestion as to
09-20-2019 05:54 AM
Instead why not use EEM Script for this :
below example help you :
09-20-2019 06:04 AM
Thanks - would this work on a switch?
09-20-2019 06:16 AM - edited 09-20-2019 06:32 AM
Hello
Possibly try this, I haven't tested it but it should run at every minute past the hour on every day of week.
event manager applet DHCP
event timer cron cron-entry "1 1-23 * * 0-6"
action 1.1 cli command "enable"
action 1.2 cli command "show ip dhcp binding | redirect tftp://IPAddress/_dhcp_binding.txt"
action 1.3 cli command "end"
09-20-2019 06:29 AM
I don't have
event manager applet
or
event timer
It's a Cisco 9300 switch I'm trying to configure it on
09-20-2019 06:33 AM - edited 09-20-2019 06:34 AM
Hello
Not sure not tried eem on 9ks before try as i posted it?
09-20-2019 06:35 AM
My mistake - I think I need to configure / create the applet first in conf t mode
09-20-2019 06:36 AM
FYI
That cron timer sequence does work as expected , just tested it on IOS
09-20-2019 06:38 AM
So is it....?
conf t
event manager applet DHCP
event timer cron cron-entry "1 1-23 * * 0-6"
action 1.1 cli command "enable"
action 1.2 cli command "show ip dhcp binding | redirect tftp://IPAddress/_dhcp_binding.txt"
action 1.3 cli command "end"
09-20-2019 06:56 AM
yes here is IOX XE reference in case if you required.
Let us know any issue.
09-20-2019 06:58 AM
Thanks for your help - I'll try it out and feedback with my findings.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: