Script Template

OpManager's script monitoring helps you execute your home-grown scripts and alerts you with the script output. It supports PowerShell, Linux shell script, VBScript, Perl & Python scripts out-of-the-box. The following script templates are commonly used and these can be imported in OpManager. You can assign this template to the device to get script outputs.

How to import/export script monitoring templates?

The import/export template option is useful when you want to share a custom template you created with the community or import a template from the community.

Importing templates

  • Step 1 : Download the required templates to your local machine.
  • Step 2 : Go to Settings > Monitoring > ScriptTemplates screen, click on the Import link to browse and import the templates.

Custom Script Templates

 
MSSQL Command output

Getting an integer value from a local or remote MSSQL db Query server using sqlcmd utility.

Download  
Use case -
Prerequisites

sqlcmd utility should have been installed in the server where OpManager is and "sqlcmd" must be a recognized command.

The remote SQL server should not be configured with dynamic ports.

The firewall should be disabled. It should not prevent OpManager server's access to remote SQL server's port.

Limitations

We can query only two columns from a table., provided the second column should return an integer value.

For better performance - query should not return more than 20 rows

Command Line cscript ${FileName}.vbs <sqlserver>\<instance,port> <dbusername_optional> <dbpassword_optional> <dbname> <query>
Arguments

sqlserver: Sql Server name

instance: Instance name

port: Mssql Port

dbusername_optional: Username (not required for local server)

dbpassword_optional: Password (not required for local server)

dbname: DataBase Name

query: Query to execute

Example cscript ${FileName}.vbs 172.10.10.10\SQLSERVER,1433 sa mssql12 EmployeeDB "select emp_name,emp_salary from Employee"
 
SNMP v2 Credential check

This script will periodically check the SNMP response and alert the user if credential is failing or SNMP agent isn't responding.

Download  
Use case There could be some situations where the SNMP service has stopped or read community string used for monitoring the devices has changed in the device. OpManager using that credential would stop collecting the data for those devices. Unfortunately, there is no option to alert the wrong credential.
Prerequisites Compatible Net-SNMP should be installed and its executable should be kept in the path ie user should be able to run the executable from any directory.
Limitations Only SNMP v1/v2/v2c can be tested.
Arguments -
Example -
 
Process Count Monitoring

This Powershell script uses WMI to get the processes on a Windows device and gives you a total count. You can configure OpManager to alert you when the number of processes exceeds a certain count.

Download  
Use case -
Prerequisites -
Limitations -
Arguments No Change
Example -
 
Windows Volume Mount Point

This VBS Script lets you monitor Windows Volumes Mount Point utilization

Download  
Use case -
Prerequisites -
Limitations -
Arguments No Change
Example -
 
SSL Certification Expiry Monitor

This is a VBScript to get the number of days remaining for a website's SSL Certificate to expire.

Download  
Use case -
Prerequisites Open SSL should be installed on the OpManager server. Change the path in the script after exporting.
Limitations -
Arguments cscript ${FileName}.vbs <ssl_addr> ${FileName}.txt
<ssl_addr> : Ssl certificate address
Example cscript ${FileName}.vbs www.google.com.br:443 ${FileName}.txt
 
Certificate Expiry Monitor

A PowerShell script to check the expiry date of the certificates in a Windows monitoring machine.

Download  
Use case -
Prerequisites -
Limitations -
Arguments -
Example -
 
Windows Security Logs Usage Monitor

VBS script to get the security logs' usage percentage of a Windows device.

Download  
Use case -
Prerequisites -
Limitations -
Arguments No need to change
Example -
 
Date and Time in Italian Format

VBScript to show the date and time in Italian Format.

Download  
Use case -
Prerequisites -
Limitations -
Arguments No Change
Example -
 
Windows Disk Utilisation Monitor

Shows the usage of Disk in percentage for each drive.

Download  
Use case -
Prerequisites -
Limitations -
Arguments No need to change any arguments
Example -
 
PoolNonpagedMemory - VBscript

VBScript to monitor the PoolNonpagedMemory in MB.

Download  
Use case -
Prerequisites -
Limitations -
Arguments -
Example -
 
Linux FileAvailability Monitor

Shell script to check whether a file is present in monitored Linux machines.

Download  
Use case -
Prerequisites -
Limitations -
Arguments sh ${FileName}.sh <Valid_File_Path>
Example sh ${FileName}.sh /home/guest/MyFile.txt
 
FileCheckSum Monitor

Shell Script to check if any changes have been done in a file.

Download  
Use case This Script checks for changes in a given file - it will raise an alarm in case of a change (any change) in the file content.
Prerequisites -
Limitations -
Arguments sh ${FileName}.sh <Valid_File_Path>
Example sh ${FileName}.sh /home/guest/test.txt
 
Windows SysupTime Monitor

To get the system up-time value in hours using WMI and to store the value in hours.

Download  
Use case -
Prerequisites -
Limitations -
Arguments Leave the commandline as it is.
Example -
 
File count Monitoring in Linux Folder

Monitoring the file count in a folder using Script Monitor.

Download  
Use case Get the number of files in folder using this Script.
Prerequisites -
Limitations -
Arguments

sh ${FileName}.sh <FolderPath>

FolderPath : Give the valid path of the folder inLinux

Example sh ${FileName}.sh /home/test/myFolder
 
Windows FileAge Monitoring

It returns the file age (created time - current time) in days, months, hours, etc. of all local and remote files under a directory and its subfolders using VBScript.

Download  
Use case -
Prerequisites -
Limitations

1. OpManager server and Remote server should exist on the same network.

2. Drives/Files of remote machine is accessible.

Arguments

cscript ${FileName}.vbs ${DeviceName} ${UserName} ${Password} <DIRECOTORY_PATH> <TIMEUNIT> <IS_RECURSIVE>

DIRECOTORY_PATH = valid directory path ( in case of remote file -> d:\ - should be provided as d$\ )

TIMEUNIT = Allowed values are - [ year, month, week, day, hour, minute and second]

IS_RECURSIVE = true to scan sub-folder, false to exclude sub-folders

Example

Remote cscript ${FileName}.vbs ${DeviceName} ${UserName} ${Password} " d$\OPMInstallation\OpManager\logs" month true

Local: cscript ${FileName}.vbs ${DeviceName} "d$\OPMInstallation\OpManager\logs" month true

 
 Pricing  Get Quote