- 2 minutes to read
-
Print
-
DarkLight
-
PDF
Execution templates
- 2 minutes to read
-
Print
-
DarkLight
-
PDF
A template is a set of commands to be executed to perform an activity by a plugin (executor). It's important to note that you can use the same execution plugin for templates with different objectives. Some activities require templates to display specific orders and commands, while others don't. A template for installing update packages has different execution steps than one that stops or restarts a service.
Register execution template
- Access Executions➞Settings➞Templates.
- In the top right corner, click (⁝) Show Actions and select New.
- Choose a Name that refers to the template's purpose so that it is easy to find whenever you need it, for example, 'Linux - Restart services'. Select Yes to ensure it is enabled.
- In Executor, select the plugin this template will use.
- In Execution type, select the Task Manager option.
- In Content, enter the commands that will be executed in the task.
- Save.
The View TAGs button presents a description for using TAGs in templates.
Below is an example of using TAGs in the creation of templates:
#Check service status
expect "*$"
exec "service --status-all"
#Root user access
expect "*$"
exec "sudo su"
#Add root user password
expect "*:"
exec "[#AUTH_PASSWORD#]"
#Stop service
expect "*#"
exec "service [#VARIABLE#] stop"
#Service status
expect "*#"
exec "service [#VARIABLE#] status"
#Restart service
expect "*#"
exec "service [#VARIABLE#] restart"
#End execution task
expect "*#"
end
Change execution template
- Access the menu Executions➞Settings➞Templates.
- Choose the template you want to change. Remember to use the filters at the top of the report if you have many registered templates.
- When locating the desired template, click Edit.
- Change the required information.
- Save.
View template change history
All changes to templates are stored in a query history. These histories are very useful for consulting and restoring templates from a specific period.
- Access Executions➞Settings➞Templates.
- Choose the template you want to change. Remember to use the filters at the top of the report if you have many registered templates.
- When locating the desired template, click (⁝), located in the Action column, and select Template change history.
- Select Template details, identified by the magnifying glass icon, and view what has changed.
Clone execution template
Cloning is helpful for new templates that need minor changes in already registered commands.
- Access Executions➞Settings➞Templates.
- Choose the template whose settings you want to copy. Remember to use the filters at the top of the report if you have many registered templates.
- When locating the desired template, click (⁝), located in the Action column, and select Clone.
- A confirmation message appears; select Yes.
- On the new screen, the template appears with the identification 'Name of your template (copy XX)'.
- Make the desired adjustments.
- Save.
Related articles
Learn more about templates: