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.
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.
Getting an integer value from a local or remote MSSQL db Query server using sqlcmd utility.
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" |
This script will periodically check the SNMP response and alert the user if credential is failing or SNMP agent isn't responding.
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 | - |
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.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | No Change |
Example | - |
This VBS Script lets you monitor Windows Volumes Mount Point utilization
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | No Change |
Example | - |
This is a VBScript to get the number of days remaining for a website's SSL Certificate to expire.
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 |
A PowerShell script to check the expiry date of the certificates in a Windows monitoring machine.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | - |
Example | - |
VBS script to get the security logs' usage percentage of a Windows device.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | No need to change |
Example | - |
VBScript to show the date and time in Italian Format.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | No Change |
Example | - |
Shows the usage of Disk in percentage for each drive.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | No need to change any arguments |
Example | - |
VBScript to monitor the PoolNonpagedMemory in MB.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | - |
Example | - |
Shell script to check whether a file is present in monitored Linux machines.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | sh ${FileName}.sh <Valid_File_Path> |
Example | sh ${FileName}.sh /home/guest/MyFile.txt |
Shell Script to check if any changes have been done in a file.
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 |
To get the system up-time value in hours using WMI and to store the value in hours.
Use case | - |
---|---|
Prerequisites | - |
Limitations | - |
Arguments | Leave the commandline as it is. |
Example | - |
Monitoring the file count in a folder using Script Monitor.
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 |
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.
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 |