Here's the script:
/*
.CHANGE_TEMPLATE_DESCRIPTION
This NCM Configuration Change Template will send a reload command to all applicable devices. It will schedule a reload at the time entered.
.PLATFORM_DESCRIPTION
This runs on Cisco IOS devices.
.PARAMETER_LABEL @ContextNode
NCM Node
.PARAMETER_DESCRIPTION @ContextNode
The node the template will operate on. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.
.PARAMETER_LABEL @RELOAD_DATE_TIME
Date and Time to reload the selected device
.PARAMETER_DESCRIPTION @RELOAD_DATE_TIME
The date and time must be entered exactly as required by IOS. Format hh:mm <1-31 Day of month> MONTH
Example: 14:00 Jan 7 - This would reload the device at 2:00 PM on the next January 7th.
*/
script RELOAD_IOS (
NCM.Nodes @ContextNode,
string @RELOAD_DATE_TIME )
{
string @CommandLine = 'reload at '
string @ShowReload = 'show reload'
foreach ( @node in @ContextNode )
{
if ( @node.Vendor == 'Cisco' )
{
CLI
{
@CommandLine @RELOAD_DATE_TIME
@ShowReload
}
}
}
}
And here's the action results:
reload at 07:00 4 Feb
Reload scheduled for 07:00:00 CST Thu Feb 4 2016 (in 21 hours and 17 minutes) by admin on vty0 (199.20.15.71)
show reload
Proceed with reload? [confirm]
No reload is scheduled.
I'm really confused why it says the reload is scheduled, and then doesn't actually schedule the reload.