Adding and editing an Active Script Action

This action allows you to write either VBScript or JScript code to perform a customized action. If the script returns an error code, the action failed.

Note: This script action has a context object you can use to get specific information about the context of the action.

Note: We have provided several code samples for you to create useful script actions for your devices.

Note: All script features in WhatsUp Gold utilize the SNMP API.

To add a new Active Script action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library appears.
  2. Click New. The Select Action Type dialog appears.
  3. Select Active Script Action, then click OK. The New Active Script Action dialog appears.
  4. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Timeout (seconds). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the device. This is considered a failed connection.

    Note: Though the maximum timeout is 60 seconds, you are discouraged from using a timeout longer than the default of 10 seconds. You are encouraged to use the shortest timeout possible.

    • Script type. Select the scripting language that you want to use to write this active script (either VBScript or JScript).
    • Script text. Enter your action code here.

    Note: We do not recommend that you use percent variables in script text, because they may resolve to text containing special characters (' ' (quotes), " " (double-quotes), % (percent), new line characters, and the like) that may break your script.

  5. Click OK to save changes.

Tip: To check the status of an action, or to cancel an action, in the WhatsUp Gold console go to Tools > Running Actions.

To edit an existing Active Script action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library dialog appears.
  2. Select the action you would like to edit, then click Edit.
  3. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Timeout (seconds). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the device. This is considered a failed connection.

    Note: Though the maximum timeout is 60 seconds, you are highly discouraged from using a timeout longer than the default of 10 seconds. You are encouraged to use the shortest timeout possible.

    • Script type. Select the scripting language that you want to use to write this active script (either VBScript or JScript).
    • Script text. Enter your action code here.

    Note: It is not recommend that you use percent variables in script text, because they may resolve to text containing special characters (' ' (quotes), " " (double-quotes), % (percent), new line characters, and the like) that may break your script.

  4. Click OK to save changes.

Tip: To check the status of an action, or to cancel an action, in the WhatsUp Gold console go to Tools > Running Actions.

See Also

Configuring an action

Adding and editing a Beeper Action

Adding and editing an Email Action

Adding and editing a Log to Text File Action

Adding and editing a Pager Action

Adding and editing a PowerShell action

Example - PowerShell action scripts

Adding and editing a Program Action

Adding and editing a Service Restart Action

Adding and editing a SMS Action

Adding and editing a SMS Direct Action

Adding and editing a SNMP Set Action

Adding and editing a Sound Action

Adding and editing a SSH Action

Adding and editing a Syslog Action

Adding and editing a Text-To-Speech Action

Adding and Editing a VMware Action

Adding and Editing a Web Alarm Action

Adding and Editing a Windows Event Log Action

Using the WinPopup Action