Scripts

Introduction

A script is a user defined job, you can define your own job tasks by writing code to be included in OS and SQL scripts. Types of execution that OpsRamp provides:

Scope of Scripts

Scripts are partner specific. Example: A script can be created, assigned and scheduled at partner level as well as client level devices.

Scenario: Schedule and assign a script

Scenario: A user wants to create a script using Powershell for monitoring and reporting the disk space, and assign the script to all devices and schedule the script to run every Friday at 6 PM.

Solution: Create a script and assign it to the devices and then provide the schedule. See below for instructions to create, assign and schedule a script.

Create, Validate and Apply a Script

In addition to native jobs, a user can create custom scripts and then apply to devices. Example: See above scenario.

Instructions for creating a script

  1. Login to OpsRamp.

  2. On the drop-down menu, click Automation.

  3. Select Scripts. Scheduled Scripts page appears.

  4. In All Scripts tab, click Add and then click Add Script.

  5. Provide the script details.

  6. Select the Script Type from the drop-down and provide the Command/File Name.

  7. If a scripting language is provided as execution type, example VBS, then copy the script in the Script section.

  8. Click Add Params.

  9. To validate the script, provide the Registry Path, Registry Value, Process Name and Service Name and then click Save.

Instructions for applying and scheduling a script

Once the script is created it is listed in Scripts page. To apply script and to schedule, click on the script.

  1. Click Apply script to devices.

  2. Select the client and the devices.

  3. To run the script instantly, click Run Now.

  4. To schedule a script, click Schedule and provide scheduled time for the script and then click Save.

Appendix: Custom Scripts

Custom Job using VBS Script

Category: Firewalls Command/FileName: firewall_disable.vbs Description: Disable Firewall

Custom Job using Python Script

Get last logged user Category: Linux Command/FileName: python Description: Get last logged user

Custom Job using Powershell Script

Category: Quick Books Maintenance Command/FileName: RestartQuickBooksService.ps1 Description: RestartQuickBooksService

Last updated

Was this helpful?