guides:user:scenarios:scenarios
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
guides:user:scenarios:scenarios [2019/12/23 13:48] – created yspeerte | guides:user:scenarios:scenarios [2024/07/03 12:31] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | |||
+ | ====== Scenario examples ====== | ||
+ | |||
+ | See the sub-menu entries for the examples. | ||
+ | |||
+ | These include command parsing, config parsing, how to work with scenarios, loops and conditions. | ||
+ | |||
+ | |||
+ | ===== Scenario basics === | ||
+ | |||
+ | Scenarios control what a job does when it is executed. Jobs are submitted to the scheduler to be launched at the desired time. When launched the scenario contains the various steps to make the desired configuration changes. | ||
+ | |||
+ | The basic scenario has a description line for the job log and is followed with one or more scenario commands that perform high-level actions on the desired node. The scenario commands include actions like '' | ||
+ | |||
+ | Each scenario command uses option flags to give it its arguments like '' | ||
+ | |||
+ | As with the templates, scenarios use variables which are enclosed in angled brackets. The most common one is | ||
+ | '' | ||
+ | |||
+ | To catch failed scenario commands the '' | ||
+ | |||
+ | Scenarios can be stored for re-use as they are created for specific tasks. These saved scenarios are maintained using the " | ||
+ | |||
+ | The simplest of scenarios is used in the " | ||
+ | |||
+ | < | ||
+ | [parameters] | ||
+ | |||
+ | [scenario] | ||
+ | Description < | ||
+ | task := Command_job | ||
+ | |||
+ | end | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | < | ||
+ | Description < | ||
+ | |||
+ | Cmd_exec -n < | ||
+ | if < | ||
+ | Log_action -n < | ||
+ | stop | ||
+ | endif | ||
+ | |||
+ | Log_action -n < | ||
+ | </ | ||
+ | |||
+ | Both the job [scenario] and the task have a '' | ||
+ | |||
+ | The '' | ||
+ | |||
+ | All vendor specific handling of protocols, login, errors, backup, file transfers, commits and saves are handled by the NetYCE vendor modules. The ''< | ||
+ | |||
+ | Scenarios (and tasks) can be extended to handle complex tasks where variables or a state can be retrieved from a node and then used to generate the correct commands and execute them. By adding more programmable syntaxes like loops changes can be made to various devices in the network if desired. | ||
+ | |||
+ | More on the scenario capabilities can be found in the reference guide on [[menu: | ||
+ | |||
+ | |||
+ | === Stop on-error === | ||
+ | |||
+ | The scenarios default behaviour to ignore ''< | ||
+ | |||
+ | If you need to revert to explicit error handling include the command '' | ||
+ | |||
+ | More on this can be fount in [[menu: | ||