Tasks are an effective way to provide actions to users that they can launch to help solve an issue with a monitored application. The following procedure shows you how to create a task that will launch a corrective batch file when the monitor you created enters a warning state.

This topic assumes that you are using the management pack created in the How to Create a Management Pack With a Discovery Using the Windows Registry Template topic and subsequent topics.

Create the batch file

  • Create a batch file called fixLOBApplication.cmd. This batch file should contain a single line:

    eventcreate /t error /id 202 /l application /d "description"

    Save this batch file in the C:\SampleMP directory.

Create the task

  1. In the Health Model window, click Tasks in the navigation tree, and then click Agent Tasks.

  2. Right-click the Agent Tasks view, click New, and then click Command Line Task (Probe Action). The Command Line Task (Probe Action) Wizard will start.

  3. In the Element ID text box, enter AuthoringConsole.MyFirstMP.Task

  4. In the Display Name text box, enter Fix LOB Application

  5. In the Target drop-down list, click AuthoringConsole.MyFirstMP.LOBApplication

  6. In the Category drop-down list, click Operations



  7. Click Next to go to the Command Line page of the wizard.

  8. In the Full path to file text box, enter c:\windows\system32\cmd.exe

    Note
    This path may be different on your system. You can also enter %Windir%\system32\cmd.exe in this step.
  9. In the Parameters text box, enter /c c:\SampleMP\FixLOBApplication.cmd



  10. Leave the Additional settings as it is, and then click Finish to create the task and return to the Agent Tasks view.

  11. Save the management pack by clicking File, and then clicking Save from the authoring console menu.

You have now created a task that can be used to launch a corrective batch file when the monitor we created enters a warning state.

See Also