This article was updated to support v11.7.8 of Goliath Performance Monitor.
Goliath Performance Monitor (GPM) Advanced Watch monitors your Windows servers/workstations by executing any Windows program, command, script, or batch file executable that you provide. It runs the executable periodically on the monitored server/workstation according to a schedule that you specify.
Configure an Advanced Watch rule
- Name the Monitoring Rule in the ‘Rule Name’, as well as define the description and the severity.
- In the “Program Name” field, define the name of the program, Powershell, command line, batch file, etc. to be opened when the alert triggers. This must be a fully qualified program name path. In order to access the network share, the agent must have rights to the share. Environment Variable substitution when bracketed with the percent character; for example, %SystemRoot% is supported.
- Examples:
- Powershell: exe or C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe
- Command or Batch file: exe or C:\Windows\system32\cmd.exe
- Executable: \\10.2.1.1\c$\scripts\alerts.exe
- or -
- Examples:
- You can optionally specify an Executable Time-Out value and GPM will terminate the executable if it does not complete on its own before the timeout expires.
- In the “Cmd-Line Options” field, define an 'Argument' string passed to the program, batch, or command file named in the Program Name field when executed.The parameters are case sensitive and must be upper case. Environment Variable substitution when bracketed with the percent character; for example, %SystemRoot% is supported. If you are returning an Exit code from your PowerShell script for processing in Goliath Performance Monitor, please see the next step for some options surrounding how you call the PowerShell script.
- Examples:
- Powershell: -ExecutionPolicyBypass -File "C:\Program Files\MonitorIT\Scripts\ps1"
- Command Line: net stop Spooler
- Examples:
- In the “Exit Code” field, define an exit code and a comparison that the GPM Agent will make against the executable exit code, and generate an alert if the comparison fails.
-
- For Exit Codes coming back from a PowerShell script, you have two options. Either define the Exit Code in your PowerShell using [Environment]::Exit(###) where ### is the Exit Code you want to pass back to Goliath Performance Monitor.
- You can also alternatively use the standard Exit command instead of using [Environment]::Exit(###) in your PowerShell script by calling the script in the “Cmd-Line Options” field with the following format:
"& 'c:\commands\ExitCodeTest.ps1' "; exit $LASTEXITCODE
-
- The optional username and password is where you would, if necessary,define a user that the Goliath Agent will use to run the executable in this user’s security context.
- In the “Start Directory” field, optionally specify when creating the process and running the executable.
- Set the “Show Program Window” check box to have the executable window GUI appear on the screen or uncheck to run the executable in the background; hidden.