Looks pretty good, at least a step in the right direction, IMHO.
I have been playing with Cisco's interpreter a little more to do scheduled jobs using Python's sched module in the standard library. Here is a simple example of how to change the hostname of the router, this can obviously made into a static file that sits in the bootflash and/or include show commands, etc. The 'scheduler.enter()' method takes the first attribute as the delay in seconds, the 'scheduler.enterabs()' method takes the first attribute as Epoch time.
Did I mention the lack of editor directly in the Cisco device drives me nuts?
Here is the example:
Python 2.7.2 (default, Mar 6 2012, 15:51:12)
[GCC 3.4.3 (MontaVista 3.4.3-25.0.143.0800417 2008-02-22)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Loaded cisco NxOS lib!
>>> import cisco, sched, time
>>> scheduler = sched.scheduler(time.time, time.sleep)
>>> def change_hostname(name):
... print "change hostname to switch_new"
... cisco.cli("config t")
... cisco.cli("hostname switch_new")
>>> scheduler.enter(30, 1, change_hostname, ('first',))
Event(time=<blah>, priority=1, action=<function change_hostname at <whatever>>, argument=('first',))
>>> scheduler.run() # 30 seconds passed
change hostname to switch_new
switch_new# <<<<< the hostname is changed
In case you are wondering, here is how to find the Epoch time in Python:
>>> import datetime, timeHere are more information and the tutorials I used:
>>> laterDate = datetime.datetime(2012, 12, 15, 13, 00, 00)
Happy scripting! :)