Share via


Debugging Runtime Scripts

Applies To: Operations Manager 2007 R2, Operations Manager 2007 SP1, System Center Operations Manager 2007

You can test and debug runtime scripts outside of the Operations Manager runtime environment.

To test a script, you can run it from a command line by using CScript.exe (the command-line version of the Windows Script Host). Any output that is generated by the script is displayed in the command window, which allows you to verify that the script is generating the appropriate results. If you discover issues with the script, you can debug it by using a scripting debugger.

For more information about debugging scripts, see https://go.microsoft.com/fwlink/?LinkId=86926.

Getting Information about Runtime Errors

If a runtime error occurs in a script that is used by an installed Management Pack, the Operations Manager agent adds an event describing the error to the Operations Manager event log. Categories of possible runtime errors include the following:

  • The script failed with a script error.

  • The script exited without providing the required output data (discovery or property bag data).

  • The script's output data was not valid.

  • The script was in the queue for too long a time.

  • The script ran past the timeout.

  • The process was stopped due to system or health service shutdown.

Script errors are written to debugging out that you can examine with a tool such as dbmon.exe.

The On Error Resume Next and Try…Catch statements are not recommended unless the script includes a handler specifically designed for these errors.

You can also add custom information about scripting errors to the event log by using the MOMScriptAPI.LogScriptEvent method. For more information, see How to Create Operations Manager Events by Using a Script.

See Also

Concepts

Getting Started Developing Runtime Scripts
Runtime Scripts Overview