![]() |
Table Of Contents
Information About the Command Scheduler
Licensing Requirements for the Command Scheduler
Prerequisites for the Command Scheduler
Configuration Guidelines and Limitations
Configuring the Command Scheduler
Enabling the Command Scheduler
Configuring Remote User Authentication
Verifying the Command Scheduler Configuration
Scheduling Maintenance Jobs
This chapter describes how to configure the Cisco NX-OS command scheduler on a device.
This chapter includes the following sections:
•
Information About the Command Scheduler
•
Licensing Requirements for the Command Scheduler
•
Prerequisites for the Command Scheduler
•
Configuring the Command Scheduler
•
Verifying the Command Scheduler Configuration
Information About the Command Scheduler
The Cisco NX-OS command scheduler provides a facility to schedule a job (set of CLI commands) or multiple jobs at a specified time in the future. The job(s) can be executed once at a specified time in the future or at periodic intervals.
You can use this feature to schedule QOS policy changes, backup data, save the configuration and other similar jobs.
This section contains the following topics:
Command Scheduler Overview
The command scheduler consists of the following parts:
•
Job—A set of Cisco NX-OS CLI commands (EXEC and config mode) that are executed as defined in the schedule.
•
Schedule—The time when the assigned jobs execute. You can assign multiple jobs to a schedule.
A schedule executes in one of the following modes:
•
Periodic mode—A recurring interval that the job executes in until you delete the job. You can configure the following types of periodic intervals:
–
Daily—Cisco NX-OS executes the job once a day.
–
Weekly—Cisco NX-OS executes the job once a week.
–
Monthly—Cisco NX-OS executes the job once a month.
–
Delta—Cisco NX-OS executes the job beginning at the specified start time and thereafter at user-specified intervals (days:hours:minutes).
•
One-time mode—Cisco NX-OS executes the job once at a user-specified time.
Remote User Authentication
The command scheduler authenticates the user who created the job before running the scheduled job. Cisco NX-OS supports locally configured authentication and remote authentication using an authentication server. Cisco NX-OS holds the user credentials from a remote authentication for a short period of time. This time period is not long enough to support a scheduled job. You need to locally configure the authentication password for any users that create jobs. These passwords are part of the command scheduler configuration and not considered a locally configured user.
Before the scheduled job executes, the command scheduler validates the local password against the password returned from the remote authentication server.
Execution Logs
The command scheduler maintains a log file. This log file is a circular log that contains the output of the job executed. If the output of the job is greater than the log file, then the output stored in this file is truncated.
High Availability
Scheduled jobs remain available after a supervisor switchover or a software reload.
Virtualization Support
Cisco NX-OS creates a scheduler job in the virtual device context (VDCs) you are logged into. By default, Cisco NX-OS places you in the default VDC. See the Cisco NX-OS Virtual Device Context Configuration Guide.
Licensing Requirements for the Command Scheduler
The following table shows the licensing requirements for this feature:
Prerequisites for the Command Scheduler
The command scheduler has the following prerequisites:
•
You must enable any conditional features before you can configure those features in a job.
•
You must have a valid license installed for any licensed features that you want to configure in the job.
•
You must have network-admin or vdc-admin user privileges to configure a scheduled job.
Configuration Guidelines and Limitations
The Command scheduler has the following configuration guidelines and limitations:
•
The scheduled job can fail if it encounters one of the following situations when executing the job:
–
If the license has expired for a feature at the time when a job containing commands pertaining to that feature is scheduled.
–
If a feature is disabled at the time when a job containing commands pertaining to that feature is scheduled.
–
If you have removed a module from a slot and the job has commands pertaining to the interfaces for that module or slot.
•
Verify that you have configured the time. The scheduler does not have any default time configured. If you create a schedule and assign job(s) and do not configure the time, that schedule is not launched.
•
While defining a job, verify that no interactive or disruptive commands (for example, copy bootflash: file ftp: URI, write erase, and other similar commands) are specified as part of a job because the job is executed noninteractively at the scheduled time.
Configuring the Command Scheduler
To configure the command scheduler, follow these steps:
Step 1
Enable the scheduler (see the "Enabling the Command Scheduler" section).
Step 2
Authorize remote user access (optional) (see the "Configuring Remote User Authentication" section).
Step 3
Define the job (see the "Defining a Job" section). .
Step 4
Specify the schedule (see the "Specifying a Schedule" section)..
Step 5
Verify the scheduled configuration (see the "Verifying the Command Scheduler Configuration" section).
This section includes the following topics:
•
Enabling the Command Scheduler
•
Configuring Remote User Authentication
Enabling the Command Scheduler
You must enable the command schedule feature before you can configure and schedule any jobs.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
DETAILED STEPS
To enable the command scheduler feature, use the following command in global configuration mode:
Command Purposefeature scheduler
Example:
switch(config)# feature scheduler
Enables the command scheduler in a VDC.
To disable the command scheduler feature in a VDC, use the following command in global configuration mode:
Command Purposeno feature scheduler
Example:
switch(config)# no feature scheduler
Disables the command scheduler. feature in a VDC.
Configuring Remote User Authentication
You can configure the command scheduler to use remote authentication for users who want to configure and schedule jobs.
Note
AAA authentication requires the clear text password of the remote user before creating and configuring command scheduler jobs.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler aaa-authentication password [0 | 7] password
3.
scheduler aaa-authentication username name password [0 | 7] password
4.
show running-config | include "scheduler aaa-authentication"
5.
copy running-config startup-config
DETAILED STEPS
:
Note
The scheduler remote user passwords are always displayed in encrypted form in the show running-config command output. The encrypted option (7) in the command exists to support applying the ASCII configuration to the device.
Defining a Job
To define a job, you must specify the job name and define the sequence of CLI commands that the job has to perform.
CautionYou cannot modify or remove a command after entering the sequence of commands. To make changes, you must explicitly delete the defined job name and restart this process.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler job name string
3.
add configuration or EXEC commands
4.
exit
5.
show scheduler job
6.
copy running-config startup-config
DETAILED STEPS
:
To delete a job, use the following command in global configuration mode:
Command Purposeno scheduler job name string
Example:
switch(config)# no scheduler job name bringup
Deletes a defined job and all commands defined within that job.
Specifying a Schedule
After defining jobs, you can create schedules and assign jobs to the schedule. Subsequently, you can configure the time of execution. The execution can be one-time or periodic depending on your requirements. If the time for the schedule is not configured, then it will never be executed.
BEFORE YOU BEGIN
Ensure that you are in the correct VDC (or use the switchto vdc command).
SUMMARY STEPS
1.
config t
2.
scheduler schedule name string
3.
job name strings
4.
time daily
5.
time weekly
6.
time monthly
7.
time start repeat
8.
time start
9.
exit
10.
show scheduler job
11.
copy running-config startup-config
DETAILED STEPS
The most significant fields in the time arguments are optional. If you omit the most significant fields, the values are assumed to be the same as the current time. For example, if the current time is March 24, 2008, 22:00 hours, then the commands are executed as follows:
•
The time start 23:00 repeat 4:00:00 command implies a start time of March 24, 2008, 23:00 hours.
•
The time daily 55 command implies every day at 22:55 hours.
•
The time weekly 23:00 command implies every Friday at 23:00 hours.
•
The time monthly 23:00 command implies the 24th of every month at 23:00 hours.
Note
If the time interval configured for any schedule is smaller than the time taken to execute its assigned job(s), then the subsequent schedule execution occurs only after the configured interval amount of time has elapsed following the completion time of the last iteration of the schedule. For example, a schedule is executed at 1-minute intervals and a job assigned to it takes 2 minutes to complete. If the first schedule is at 22:00 hours, the job finishes at 22:02 after which, the 1-minute interval is observed and the next execution occurs at 22:03 and finishes at 22:05.
Configuring Execution Logs
You can configure the log file size to be a maximum of 1024 KB. The default size of the execution log file is 16 KB.
To configure the execution log file size, use the following command in global configuration mode:
Command Purposescheduler logfile size value
Example:
switch(config)# scheduler logfile size 1024
Configures the log file size. The range is from 16 to 1024 KB. The default is 16KB.
Use the clear scheduler logfile command to clear this file.
Verifying the Command Scheduler Configuration
To display the command scheduler configuration information, use the following commands:
Default Settings
Table 6-1 lists the default settings for command scheduling parameters.
Table 6-1 Default Command Scheduler Parameters
Parameters DefaultCommand scheduler
Disabled.
Log file size
16 KB.
Additional References
For additional information related to implementing scheduled jobs, see the following sections:
Related Documents
Related Topic Document TitleCommand scheduler CLI commands
Cisco NX-OS System Management Command Line Reference
VDCs
Cisco NX-OS Virtual Device Contexts Configuration Guide
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—