{{indexmenu_n>2}} ====== Scenario Commands ====== Scenario Commands can be called upon in scenarios. They can return nothing, a list variable or a hash variable. When they fail, the -variable is set. Several of the commands will benefit from the support of 'here documents' as a way to avoid creating trivial templates. Please see the section on [[menu:operate:scenarios:commands#Here documents|Here documents]] ===== Commands ===== ==== cmd_exec ==== Execute command line-by line on cli of a NetYCE managed node. ==Mandatory options:== -n node hostname of the node -f cmd_file file containing the commands you want to execute ==Optional options:== [-o ] use the 'origin' node as the context node. Commands are executed on the -n node. [-c ] use 'console', 'api' or 'management' connection [-a
] overrides the address of the node [-d ] overrides the management domain of the node [-v ] overrides the vendor type of the node [-q] sets quick-mode: skip config save/backup/nccm [-e] cancels the normal stop-on-error behaviour [-u ] use NetYCE credentials for first attempt to logon to the device. The ''-u'' option refers to a NetYCE user account. The username and password of this account will be used to login to the device. When available, the ''Device password'' value will be used as the password instead of the login password of the account. This NetYCE account will be used as the first set of credentials to login to the device. The ''rme_user'' and ''local_user'' credentials will still be attempted should login fail. The ''-e'' option overrides the default behaviour of aborting all remaining commands when an error was detected. When used, the device response is not checked for errors or warnings and execution proceeds with the next command. The logs will not indicate an error was encountered. ==== cmd_exec_basic ==== Execute command line by line on cli of a node in the CMDB table ==Mandatory options:== -n node hostname of the node -f cmd_file file containing the commands you want to execute -a the address of the node -d the management domain of the node -v the vendor type of the node ==Optional options:== [-c ] use 'console', 'api' or 'management' connection [-u ] use NetYCE credentials for first attempt to logon to the device. The ''-u'' option refers to a NetYCE user account. The username and password of this account will be used to login to the device. When available, the ''Device password'' value will be used as the password instead of the login password of the account. This NetYCE account will be used as the first set of credentials to login to the device. The ''rme_user'' and ''local_user'' credentials will still be attempted should login fail. ==== resched_job ==== > Note This command is not available for releases prior to 7.2.0. Schedule the running job to execute again. The ''resched_job'' command allows for recurring jobs. It is included in a scenario to reschedule the same job for a later day and/or time. Since the rescheduled job will execute the same scenario, this job will again be rescheduled for a later moment. In effect, the task will become a repeated job. To stop the job from rescheduling itself it needs to be manually 'cancelled' using the "Operate - Jobs" tool. == Mandatory options == It is mandatory to specify the ''-i'' (interval) or ''-t'' (daytime) option. -i interval reschedule this job at the "interval" after current start time "interval" format in 'd' 'h' 'm' or a combination like "1d 2h 30m' or '72h" no 'now' supported -t daytime reschedule this job at "daytime" "daytime" format like "tomorrow 5:05" or "sunday 0:00" no 'now' or date supported A maximum of eight (8) days can be scheduled ahead of the current time using either the 'interval' or 'daytime' option. The valid values for the 'day' in the "daytime" format are: today, tomorrow, monday, tuesday, wednesday, thursday, friday, saturday, sunday, or their three-letter abbreviations. Using a '-t' option like 'today 18:00' will result in a job that repeats itself at 18:00 the same day, but since at that time this 18:00 will be past, the re-scheduling will stop. No error is raised for this. If the '-t' is 'tomorrow 18:00' the rescheduled job will again be scheduled for the next day as its targeted time will forever be in the future. == Optional == [-s] set server selection to '-auto-' instead of using same server Job parameters are reused from the scheduler and job files: - reuse scenario file - reuse command file - reuse parameters file - operator will stay the same - reuse the change-id - reuse the queue - reuse the description - jobtype stays the same - reuse job-rule validations / approvals The NetYCE server where the job will be rescheduled is the same as the current server by default. Only when the '-s' option is used will the server set to ''-auto-''. It is not possible to assign a different server directly. ===== Configs ===== ==== config_create ==== Generate commands from template. ==Mandatory options:== -n node hostname of the node ==Optional options:== [-t