Tasks contain the deployment parameters you want to use in different remediation plans. You can also use tasks to run scripts on your servers, regardless to the Remediation Plan.
When creating a task you can use a Script, an Execution Line or both. Before creating a task, you should add scripts to your library.
Note: It is recommended to run tasks that have scripts uploaded to JetPatch itself, instead of running it from the server.
Tasks Types
There are three types of tasks -
- User-created tasks - Tasks that were added by the user to JetPatch. They can be based on JetPatch built-in scripts, user scripts or not at all (Command Line tasks)
- Built-in tasks - Tasks that were created by the JetPatch team as part of the product. Those tasks can't be modified or duplicated and should work out-of-the-box.
Built-In tasks have a dedicated sign -
Note - User can create a task that is based on the same script that Built-In tasks are using. - Built-in service - A Built-In service is a special built-in task which is not using the regular tasks execution command to the Connector. Each built-in service is a fully dedicated mechanism involving Connector special actions without any interpreter/shall involvement. Those tasks can be edited with dedicated settings, unique for each service, and can't be duplicated.
Built-in services have a dedicated sign -
It will also have a special sign when selecting the tasks to execute on endpoints in the environment -
Task Library
The Task library contains the tasks you have created and Built-in Tasks created by JetPatch, these Tasks can't be changed in any way.
- To view the Library Select System > Tasks from the main menu
- The Search bar at the top left corner will enable you to search by Task name only.
- Filter Option: Category, Created by and Script
- You can Duplicate, Edit, or Delete Tasks by clicking on the action button on the right
- Note: You are unable to delete a task that was added to a workflow assigned to a remediation plan
Create a New Task
- Select System > Tasks from the main menu
- Click on +Add
- Fill in the relevant details:
- Task name
- Description
Execution Tab
-
-
- Task Source - Script: The task is based on a script with default command execution
- Script - Choose the script to run
- Note1: The default execution line is @file @param1=default1 @param2=default2
- Note2: If the task source is a script, JetPatch identifies the operating systems that the script can run on, and allows to run it only on the matching endpoints.
- Script - Choose the script to run
- Task Source - Command line: For stand-alone tasks that are not based on a script, but just on the provided command line
- Execution Type - Choose the execution type of the command line
- Includes all CLI tools (eg. Salt, Awk, Puppet)
- Execution Command - the Command that will be executed
- Note1: The operating system for the command line is not specified and therefore these tasks are visible on all endpoint types.
- Execution Type - Choose the execution type of the command line
- Task Source - Both: The task is based on a script with a custom command execution (for scripts that need a different execution line than the default one)
- Task Source - Script: The task is based on a script with default command execution
-
Configuration Tab
-
-
- Timeout - the timeout for the task to run
- Execution reboot procedure - In a successful task execution, the endpoint will be suspended from any new patching activity, until a reboot happens.
-
Parameters Tab
Relevant only for a script-based task with parameters. Defining each parameter value for execution.
- Click Save
Run Task
You can run tasks directly from the Management table (Endpoints > Management)
To do so, select an endpoint and click on "SELECT ACTION", then choose "Run Task" and execute your tasks.
Progress of run task can be monitored from the activities table.
More information on Run Task.
Examples
1. Run a bash script on an endpoint
Note: When using bash, there is no need to change the default execution line. Please make sure you have added a bash script to your script library ahead of time.
- Create a new task
- Choose Script Start Stop Service Linux (bash script)
- Go to the Parameters tab and insert value for 'ActionName' and 'Service Name'. For example: start , syslog
- See the Execution Preview changes accordingly
- Save task and run on endpoints
2. Run a PowerShell script on an endpoint
Note: When using PowerShell scripts, Task source should be changed to Both.
- Create a new task
- Change Task source to 'Both'
- Choose a PowerShell Script with parameters you've uploaded
- Select Execution Type: PowerShell
- Enter the following execution command: ./@file @param1 @param2 (as many parameters as needed)
Related Articles
- Scripts
- Built-in services -
- How to execute a Binary Executable File
- Activities
Comments
0 comments
Please sign in to leave a comment.