- Solutions
-
- File Server: Ransomware Protection
- File Server: File Copy
- File Server: Audit File Access
- File Server: Storage growth reporting
- Licensing/Pricing
- Contact
This help page is for version 5.6. The latest available help is for version 9.4.
The Execute Script Action allows you to receive action parameters that were sent from a monitor and handle them in your own specific way.
The script is run using the computer's built-in VBScript, JavaScript or Powershell interpreter. This means you can make use of the full scripting language as well as any installed 3rd party components that are installed on the system.
Near the top of the action dialog is a "Run script at" selection box. Here you can specify where the script should be run if you have Satellite monitoring services. The default is to run the script on the Central Monitoring Service.
The next control simply allows you to select the language for your script. If the script window is empty or still showing the default script, changing the current language will show a new default script in the language you speciy.
The script window is where you enter your script. The script can do anything that can be done in the select language (including creating external components) with all the standard restrictions. A good VBScript reference is available at: http://msdn.microsoft.com/en-us/library/d1wf56tt.aspx
There are two Test buttons. One will run the script within the Console. The other will send the script to the monitoring service that is monitoring the target computer (Central Monitoring Service or a Satellite) and run the script there. This helps find any problems that might come up from the script possibly running on a different machine, or running as a different user (the service Log As user).
Keep in mind that when the script runs, it might run on a different computer than where you are editing it. That means drive mappings, HKEY_CURRENT_USER registry hive, Internet Explorer settings and the currently running user will often be different.
IMPORTANT: Do not show any user interface elements in the script -- they will not be visible in the monitoring service and will block the script from ever completing.
Besides the scripting language's own objects and elements, the following additional global variables and methods are available within each scripting environment:
AlertType |
This value indicates if the script is running because of an alert condition, a fixed condition, because an error was acknowledged, or for a reminder of a still open error. |
||||||||||||||||||||||||||||||||||||||||||||||||
CurrentValue |
This is an array of string values, representing the current value (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
CustomProp |
This function retrieves the named value of a custom property. It checks the Monitor first, and if not found, checks the monitor's owning computer, and then the computer's group, and then the group's parent group, etc.
Custom properties can be set on Groups, Computers and Monitors by right-clicking on the item and choosing the Custom Properties menu.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Details |
This is a string value. This value is the content of the action being fired. It is sent from the monitor and typically contains information
about the alert.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Description |
This is an array of string values, representing a description of this particular item's status. The Details value (above) is usually all of the Description values appended together.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Extra1 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Extra2 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Group |
The name of the group that the computer the monitor is attached to belongs in.
|
||||||||||||||||||||||||||||||||||||||||||||||||
GroupPath |
The name of the group that the computer the monitor is attached to belongs in, with child groups delimited with a > (ie, Servers/Devices > Austin > Lab )
|
||||||||||||||||||||||||||||||||||||||||||||||||
InventoryValue |
Request an inventory value for the current computer, or a different one. An inventory propertyID must be used to specify which inventory value to retrieve. An optional ComputerID value
can be used to get the inventory value from a computer other than the current computer. If a property can have multiple values (CPU Names for example), each one will have a newline character appended.
The inventoryID values are given below. Note that not all computers/devices will have all inventory values, and some may have none (especially if an Inventory Collector monitor is not added to the computer).
|
||||||||||||||||||||||||||||||||||||||||||||||||
Item |
This is an array of string values, representing the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
ItemType |
This is an array of string values, representing the type of item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
LimitValue |
This is an array of string values, representing the limit/threshold (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Machine |
This read-only string variable is the name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineAlias |
This read-only string variable is the aliased name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineIP |
IP address text string of the computer that the firing monitor is attached to
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineID |
Returns the numeric value that uniquely identifies this computer (Computer ID - CID) within the application. Useful in conjunction with the External API.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MonitorTitle |
This read-only string variable is the title of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MonitorType |
This read-only string variable is the type of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
SecondsInError |
Number of seconds that the monitor has been in error.
|
||||||||||||||||||||||||||||||||||||||||||||||||
State |
An array of string values that contain the OK or PROBLEM state for each item being reported on. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
SendMail |
This method sends an email message to the recipient that you choose. This would be useful for sending the incoming Details variable to a different email recipient
based on some external factors (such as who is currently carrying the pager)
|
||||||||||||||||||||||||||||||||||||||||||||||||
Sleep |
This method takes a single integer value, which is the number of milliseconds that the script should stop and sleep. Be careful about
using this -- causing too many actions to sleep for very long means other actions may get delayed
|
||||||||||||||||||||||||||||||||||||||||||||||||
Status |
A read-only string indicating the current status of the monitor. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
StatusText |
A read-only string indicating the current status of the monitor. This is a more human-friendly value than Status. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
TimeInErrorStr |
A text string of how long the monitor has been in error
|
||||||||||||||||||||||||||||||||||||||||||||||||
ToLog |
This method takes a string value and appends it to the service's log file (useful for debugging scripts). The line will start with ACTION_SCRIPT_LOG.
|
AlertType |
This value indicates if the script is running because of an alert condition, a fixed condition, because an error was acknowledged, or for a reminder of a still open error. |
||||||||||||||||||||||||||||||||||||||||||||||||
CurrentValue |
This is an array of string values, representing the current value (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
CustomProp |
This function retrieves the named value of a custom property. It checks the Monitor first, and if not found, checks the monitor's owning computer, and then the computer's group, and then the group's parent group, etc.
Custom properties can be set on Groups, Computers and Monitors by right-clicking on the item and choosing the Custom Properties menu.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Details |
This is a string value. This value is the content of the action being fired. It is sent from the monitor and typically contains information
about the alert.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Extra1 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Extra2 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Group |
The name of the group that the computer the monitor is attached to belongs in.
|
||||||||||||||||||||||||||||||||||||||||||||||||
GroupPath |
The name of the group that the computer the monitor is attached to belongs in, with child groups delimited with a > (ie, Servers/Devices > Austin > Lab )
|
||||||||||||||||||||||||||||||||||||||||||||||||
InventoryValue |
Request an inventory value for the current computer, or a different one. An inventory propertyID must be used to specify which inventory value to retrieve. An optional ComputerID value
can be used to get the inventory value from a computer other than the current computer. If a property can have multiple values (CPU Names for example), each one will have a newline character appended.
The inventoryID values are given below. Note that not all computers/devices will have all inventory values, and some may have none (especially if an Inventory Collector monitor is not added to the computer).
|
||||||||||||||||||||||||||||||||||||||||||||||||
Item |
This is an array of string values, representing the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
ItemType |
This is an array of string values, representing the type of item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
LimitValue |
This is an array of string values, representing the limit/threshold (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Machine |
This read-only string variable is the name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineAlias |
This read-only string variable is the aliased name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineIP |
IP address text string of the computer that the firing monitor is attached to
|
||||||||||||||||||||||||||||||||||||||||||||||||
MachineID |
Returns the numeric value that uniquely identifies this computer (Computer ID - CID) within the application. Useful in conjunction with the External API.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MonitorTitle |
This read-only string variable is the title of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
MonitorType |
This read-only string variable is the type of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
SecondsInError |
Number of seconds that the monitor has been in error.
|
||||||||||||||||||||||||||||||||||||||||||||||||
State |
An array of string values that contain the OK or PROBLEM state for each item being reported on. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
SendMail |
This method sends an email message to the recipient that you choose. This would be useful for sending the incoming Details variable to a different email recipient
based on some external factors (such as who is currently carrying the pager)
|
||||||||||||||||||||||||||||||||||||||||||||||||
Sleep |
This method takes a single integer value, which is the number of milliseconds that the script should stop and sleep. Be careful about
using this -- causing too many actions to sleep for very long means other actions may get delayed
|
||||||||||||||||||||||||||||||||||||||||||||||||
Status |
A read-only string indicating the current status of the monitor. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
StatusText |
A read-only string indicating the current status of the monitor. This is a more human-friendly value than Status. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
TimeInErrorStr |
A text string of how long the monitor has been in error
|
||||||||||||||||||||||||||||||||||||||||||||||||
ToLog |
This method takes a string value and appends it to the service's log file (useful for debugging scripts). The line will start with ACTION_SCRIPT_LOG.
|
PowerShell interaction happens via the $act object.
$act.AlertType |
This value indicates if the script is running because of an alert condition, a fixed condition, because an error was acknowledged, or for a reminder of a still open error. |
||||||||||||||||||||||||||||||||||||||||||||||||
$act.CurrentValue |
This is an array of string values, representing the current value (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.CustomProp |
This function retrieves the named value of a custom property. It checks the Monitor first, and if not found, checks the monitor's owning computer, and then the computer's group, and then the group's parent group, etc.
Custom properties can be set on Groups, Computers and Monitors by right-clicking on the item and choosing the Custom Properties menu.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Details |
This is a string value. This value is the content of the action being fired. It is sent from the monitor and typically contains information
about the alert.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Extra1 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Extra2 |
This is an array of string values, representing extra information that may be available from a particular monitor. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Group |
The name of the group that the computer the monitor is attached to belongs in.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.GroupPath |
The name of the group that the computer the monitor is attached to belongs in, with child groups delimited with a > (ie, Servers/Devices > Austin > Lab )
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.InventoryValue |
Request an inventory value for the current computer, or a different one. An inventory propertyID must be used to specify which inventory value to retrieve. An optional ComputerID value
can be used to get the inventory value from a computer other than the current computer. If a property can have multiple values (CPU Names for example), each one will have a newline character appended.
The inventoryID values are given below. Note that not all computers/devices will have all inventory values, and some may have none (especially if an Inventory Collector monitor is not added to the computer).
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Item |
This is an array of string values, representing the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.ItemType |
This is an array of string values, representing the type of item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.LimitValue |
This is an array of string values, representing the limit/threshold (if any) for the item being tested. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Machine |
This read-only string variable is the name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.MachineAlias |
This read-only string variable is the aliased name of the computer that caused the script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.MachineIP |
IP address text string of the computer that the firing monitor is attached to
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.MachineID |
Returns the numeric value that uniquely identifies this computer (Computer ID - CID) within the application. Useful in conjunction with the External API.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.MonitorTitle |
This read-only string variable is the title of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.MonitorType |
This read-only string variable is the type of monitor that caused this script action to fire.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.SecondsInError |
Number of seconds that the monitor has been in error.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.State |
An array of string values that contain the OK or PROBLEM state for each item being reported on. See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.SendMail |
This method sends an email message to the recipient that you choose. This would be useful for sending the incoming Details variable to a different email recipient
based on some external factors (such as who is currently carrying the pager)
|
||||||||||||||||||||||||||||||||||||||||||||||||
Sleep |
This is a PowerShell cmdlet that takes two parameters and is not part of the $act object. The first parameter specifies timer in seconds (-s) or milliseconds (-m) and the second is an integer that specifies period of time.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.Status |
A read-only string indicating the current status of the monitor. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.StatusText |
A read-only string indicating the current status of the monitor. This is a more human-friendly value than Status. To see all possible values, See Row Variables from the "Variables..." button for the action.
|
||||||||||||||||||||||||||||||||||||||||||||||||
$act.TimeInErrorStr |
A text string of how long the monitor has been in error
|
The SSH script works using replacement variables. You can use the variables below which will be replaced with the real values from the monitor. Then the finished script is set to the target computer to be executed.
$AlertID$ | A unique integer value representing this error. If Event Deduplication is enabled, this value will represent the latest error of this type. |
$CustomProp$ | $CustomProp(propertyName)$ will be replaced with the value of propertyName which can from from the source monitor, source computer or a parent group. |
$Date$ | Date in a human-readable format |
$Details$ | Details of the alert, meaning the text that is normally seen in an email alert for example. |
$Details_Single_Line$ | Same as $Details$ above, but all new lines and carriage returns have been removed |
$Group$ | Name of the group that the owning monitor is in (i.e. could be a value like "Routers"). |
$GroupPath$ | Full path name of the group that the owning monitor is in (i.e. could be a value like "Servers/Devices > Boston > Routers") |
$Machine$ | Name of the target server |
$MachineAlias$ | Alias of the target server if one has been set. There will be no value (meaning an empty string) if no alias has been set. |
$MachineID$ | Internal ID representing the target server. These IDs can be obtained using the External API. |
$MachineIP$ | IP address of the target server |
$MonitorType$ | Textual name of the monitor type (i.e. "Event Log Monitor") |
$NL$ | Value that gets turned into a carriage return-newline pair. |
$Status$ | Text representing the monitor status. To see all possible values, See Row Variables from the "Variables..." button for the action. |
$StatusText$ | A text value that is more human-friendly that $Status$ above. To see all possible values, See Row Variables from the "Variables..." button for the action. |
$Time$ | Human readable time on the monitoring server. |
$TimeInError$ | Human readable amount of time the monitor has been in an error/alert state.