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
-
In the Health Model window, click Tasks in the navigation tree, and then click Agent Tasks.
-
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.
-
In the Element ID text box, enter AuthoringConsole.MyFirstMP.Task
-
In the Display Name text box, enter Fix LOB Application
-
In the Target drop-down list, click AuthoringConsole.MyFirstMP.LOBApplication
-
In the Category drop-down list, click Operations
-
Click Next to go to the Command Line page of the wizard.
-
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. -
In the Parameters text box, enter /c c:\SampleMP\FixLOBApplication.cmd
-
Leave the Additional settings as it is, and then click Finish to create the task and return to the Agent Tasks view.
-
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.