You can add tasks to your management pack that can be run to help diagnose issues and assist in recovery. In this topic, you will add a diagnostic task to your sample management pack and then test it.
Note |
---|
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 and subsequent topics. |
Create the Diagnostic Task
-
In the Health Model space of the main authoring console window, expand the Tasks node, and then clickt Diagnostics.
-
Right-click in the Diagnostics list, then click New on the context menu, and then click Command Line Task.
-
On the Command Line Task page, enter AuthoringConsole.MyFirstMP.DiagnosticTask in the ID field.
-
Enter Diagnostic Task in the Display Name field.
-
Select AvailabilityHealth from the Category drop-down list, and then click Next.
-
On the Trigger Settings page, select AuthoringConsole.MyFirstMP.LOBApplication from the Target drop-down list.
-
Select AuthoringConsole.MyFirstMP.MonitorConnectionState from the Monitor drop-down list.
-
Select Warning from the Monitor Health State drop-down list, and then click Next to display the Configure Command Line Execution Settings page.
-
On the Configure Command Line Execution Settings page:
- Enter c:\windows\system32\ipconfig.exe
in the Full path to file field.
Note This path may be different on your system. You can also enter %Windir%\system32\ipconfig.exe in this step. - Enter /all in the Parameters
field.
- Click Finish to save the diagnostic
and return to the Diagnostics list view.
- Enter c:\windows\system32\ipconfig.exe
in the Full path to file field.
-
Save the management pack.
-
Upload the management pack to the management group by clicking Tools, and then clicking Upload to management group from the authoring console menu.
-
Select the appropriate management group from the Connect To Server dialog box, and then click Connect.
Test the Diagnostic
-
In the Operations Console, click the Monitoring button.
-
On the monitored server, run the following command from a command line:
EventCreate /id 201 /t information /d Test
-
Observe the state of the LOB Application instance as it becomes unhealthy.
-
Right-click the LOB Application in the LOB Application State list view, click Open, and then click Health Explorer for AuthoringConsole.MyFirstApp.LOBApplication from the context menu.
-
Expand the Entity Health and Availability nodes in the Health Monitors list on the left side of the authoring console window, and then click the LOB Application Connection State monitor.
-
Click the State Change Events tab, and then select the warning event in the list view.
-
In the Details area, locate the diagnostic task you just defined, click it, and then click Yes to confirm that you want to run the diagnostic task.
-
The diagnostic output displays in the details view.
See Also
Tasks
How to Create TasksHow to Create a Monitor