Вы находитесь на странице: 1из 14

Microsoft Virtual Labs

Building Management Packs with


the Authoring Console
Building Management Packs with the Authoring Console

Table of Contents
Building Management Packs with the Authoring Console ....................................................... 1
Exercise 1 The Authoring Console ................................................................................................................................2
Exercise 2 Creating the Class and Discovery Required to Manage a Windows Application ........................................3
Exercise 3 Monitoring a Windows Application Through Monitors ..............................................................................5
Exercise 4 Collecting Data About a Windows Application Through Rules ..................................................................6
Exercise 5 Creating Tasks Associated to a Windows Application ................................................................................7
Exercise 6 Creating Views to View the Health of a Windows Application ..................................................................9
Exercise 7 Testing a Management Pack from Operations Manager ............................................................................ 10
Exercise 8 Adding Diagnostics and Recoveries for a Windows Application .............................................................. 11
Building Management Packs with the Authoring Console

Building Management Packs with the


Authoring Console

Objectives After completing this lab, you will be better able to:
 Manage a windows application
 Create tasks, data, and views for a windows application
 Test a management pack from Operations Manager

Scenario This lab covers the following:


 Introduce the authoring console
 Creating the class and discovery required to manage a windows application
 Monitoring a windows application through monitors
 Collecting data about a windows application through rules
 Creating tasks associated to a windows application
 Adding powerful knowledge for monitoring a windows application
 Creating views to view the health of a windows application
 Testing a management pack from Operations Manager
 Adding Diagnostics and Recoveries for a windows application
 Using this windows application in a distributed application definition

Estimated Time to 90 Minutes


Complete This Lab

Computers used in this


Lab OpsMgrAuthoring

The password for the Administrator account on all computers in this lab is:
Password1

Page 1 of 12
Building Management Packs with the Authoring Console

Exercise 1
The Authoring Console

Scenario
In this exercise you will get familiar with the Authoring Console.

Tasks Detailed Steps


Complete the following a. Open Windows Explorer.
tasks on: b. Right click My Computer and click Properties.
c. Click the Advanced tab.
OpsMgrAuthoring
d. In the Performance section, click Settings.
e. Click the Advanced tab.
1. Before you begin
f. In the Virtual Memory section, click Change.
g. Click the System managed size radio button.
h. Click Set.
i. Click OK to close all properties windows.
2. Create an Intranet a. On the desktop, double-click the shortcut to the Authoring Console.
Capacity Model b. Click File | Open.
c. Navigate to C:\files\Builds\SelectCDImage-SP1RTM\ManagementPacks and
open the Microsoft.SQLServer.Library.mp.
d. Switch to Service Model and look at the classes that have been defined in the MP.
Open a few classes and look at the properties defined and the class that was used
as the base class. Do this for some of the relationships too.
Note: The Authoring console is the best way to create and edit these classes and
relationships (the other option is XML directly editing these definitions). These
definitions form the bases for the management pack as all data collected for SQL in
this case will be associated to one of these objects so it is important to give it some
thought. Also realize that it is a model and a model is only an approximation of the
real world and is never perfect. The SQL MP will need to define all the health models
and monitoring logic against these classes.
e. Look at the nodes under Health Model and Presentation. You will not find the
monitoring rules you saw from the Operations Console as you only opened the
SQL Library MP where the common items between SQL versions were defined.
f. Close the Authoring Console.

Page 2 of 12
Building Management Packs with the Authoring Console

Exercise 2
Creating the Class and Discovery Required to Manage a
Windows Application

Scenario
In this exercise and for the rest of the lab your are going to be building a management pack for an application that
exists on the system that is also our DC and OpsMgr root mgmt server. This application like most applications
installs a registry key, is implemented as a windows service and writes events to the event log and log files when
different things happen. Our management pack is going to be able to discover which windows servers have this
application installed on it and then will automatically monitor it. Think back to the application as you walk through
the different steps and don’t lost sight of our overall goal. Immediate

Tasks Detailed Steps


Complete the following a. Open a new instance of the Authoring Console.
task on: b. Click File | New.
c. Select Windows Application (Registry) and enter the Management Pack Identity
OpsMgrAuthoring of AuthoringConsole.MyFirstMP.
Note: This will become the file name of the management pack as well (the filename
1. Create the must match the ID)
Management Pack
d. Click Next
e. Enter a Display Name of MyFirstMP and click Next.
f. Enter AuthoringConsole.MyFirstMP.LOBApplication as the ID of the class.
g. Enter LOB Application as the Display Name of the class and click Next.
Note: By default the wizard does not specify a key property which means there cannot
be more than 1 instance of this class on any 1 windows server as a Windows Local
Application class is hosted by a windows computer so its scope is through the
windows computer hosting it. If there are multiple instances on a windows computer
then you will need a key property and create the class outside of the wizard.
h. On the Discover Schedule page, enter 60 Seconds under Run every.
i. Click Next.
j. Click Add to add an attribute to collect from the registry.
Configure the attribute as follows:
 Object Type: Key
 Name: LOBApplicationExists
 Path: Software\LOB
 Attribute Type: Check if Exists
k. Click OK and then click Add to add a second attribute.
Configure the attribute as follows:
 Object Type: Key
 Name: LOBApplicationVersion
 Path: Software\LOB\Version
 Attribute Type: String
l. Click OK to return to the attribute page.
Note: You have created 2 attributes with the following names. You will use these

Page 3 of 12
Building Management Packs with the Authoring Console
Tasks Detailed Steps
names and do some expression matching on the next page.
m. Click Next.
n. Click Insert and add the following properties:
 Parameter Name: Values/LOBApplicationExists
 Operator: equals
 Value: true
o. Click Create.
p. Select File | Save As from the menu.
q. Save to directory C:\HOL-MPAuthoring.
r. Select File | Management Pack Properties from the menu.
s. Select the References tab to see the default references that were added to your MP.
t. Click OK.
Note: This wizard created a class for us. A class is needed as you need some way to
describe/model the different instances of our LOB Application that you discover (it
could be installed on 25 servers out of 500 one day and then 30 another and OpsMgr
makes sure the MP is at the right place at the right time, which is all based on the
discovery logic). Lets add a property to this class.
u. Select the Service Model space in the console and click on the Classes view in the
navigation tree.
v. In the class list view, open the one class that was created.
w. Go to the Properties tab.
x. Right click in list of properties on the left, right click and choose Add Property.
y. Type Version and click OK.
z. Enter the display name as Version and click OK to save the class.
Note: This wizard also created the discovery that tells OpsMgr HOW to find LOB
Application’s. The discovery by default runs on all Windows computers that are
monitored by the OpsMgr mgmt group that the MP is imported into. For example if
there are 1000 windows computers being monitored in a mgmt group then it will run
against all 1000 windows computers (regardless if they are agent or agentless
monitored) and the discovery will automatically find the number of servers that have
the LOB application installed on it.
There are a number of technologies that can be used to perform the discovery. It can
be configured to look at the registry, which is normally (95% of the time) done first.
WMI information can also be used and so can a script, which provides the most
flexibility.
To view the discovery that was created.
aa. Select the Health Model space in the console and click on the Discoveries view in
the navigation tree.
bb. Open the discovery that was created and view the settings.

Page 4 of 12
Building Management Packs with the Authoring Console

Exercise 3
Monitoring a Windows Application Through Monitors

Scenario
This section will show you how to create a two state event monitor that rolls up to the availability of the LOB
Application class.

Tasks Detailed Steps


Complete the following a. Select the Health Model space in the console and click on the Monitors view in
task on: the navigation tree.
Note: You will see a single class which is the class you created at the start of this
OpsMgrAuthoring exercise. Expand the class and you will see the standard aggregate monitors that all
classes inherit.
1. Create a Monitor b. Right click and select New | Windows Events | Simple | Event Reset.
c. Enter the configuration on the general page as follows:
 Element ID: AuthoringConsole.MyFirstMP.MonitorConnectionState
 Display Name: LOB Application connection state
 Target: AuthoringConsole.MyFirstMP.LOBApplication
 Parent Monitor: System.Health.AvailabilityState
 Category: StateCollection
d. Click Next.
e. Leave Application for the Log name and click Next.
f. Set the Event ID to equal 201 and the Event Source to equal EventCreate.
g. Click Next.
h. Leave Application as the name of the log for the healthy event and click Next.
i. Set the Event ID to equal 202 and the Event Source to equal EventCreate.
j. Click Finish to create the monitor.
k. Save the management pack by selecting File | Save from the menu.
l. Double-click the monitor that was just created.
m. Click the Alerting tab.
n. Click to select Generate alerts for this monitor.
o. Choose to Generate alerts for this monitor and change the drop down to generate
an alert for a warning health state.
p. Then click OK.

Page 5 of 12
Building Management Packs with the Authoring Console

Exercise 4
Collecting Data About a Windows Application Through Rules

Scenario
This section will show you how to create a rule that collects an event collection rule that is targeted to the class that
has been created.

Tasks Detailed Steps


Complete the following a. Select the Health Model space in the console and click on the Rules view in the
task on: navigation tree.
b. Right click in the list view and select New | Collection | Event Based | Windows
OpsMgrAuthoring Event Collection
c. Enter AuthoringConsole.MyFirstMP.LOBApplicationApp.CollectEvent101 as
1. Create a rule to the Element ID of the rule.
collect data d. Enter Collect event 101 as the Display Name.
e. Select AuthoringConsole.MyFirstMP.LOBApplication from the drop-down for
the Target.
f. Click Next.
g. Leave Application as the Log name of the Windows Event Log.
h. Click Next.
i. On the expression page set the Event ID to equal 101 and the Event Source to
equal EventCreate.
j. Click Finish to create the rule.
k. Save the management pack by select File | Save from the menu.
Note: This will collect all event 101 events. Let’s look at the another common source
for events log files.
l. Ensure the Health Model tab and the Rules view is selected in the navigation tree.
m. Right click in the list view and select New | Collection | Event Based | Text Log
(Delimited).
n. Enter AuthoringConsole.MyFirstMP.LOBApplication.CollectLogFile as the
Element ID of the rule.
o. Enter Collect log file as the Display Name.
p. Select AuthoringConsole.MyFirstMP.LOBApplication from the drop-down list
for the Target.
q. Click Next.
r. On the Application Log Data Source page, set the Directory to C:\HOL-
MPAuthoring then set the Pattern to *.log and the Seperator as , (comma) and
then click Next.
s. Click Insert and specify the Parameter Name = LogFileType, Operator =
Equals and Value = Generic CSV Log File Format.
t. Click Finish to create the rule.
u. Save the management pack by selecting File | Save from the menu.

Page 6 of 12
Building Management Packs with the Authoring Console

Exercise 5
Creating Tasks Associated to a Windows Application

Scenario
Tasks are a powerful way to provide actions to users that can be launched in context to solving a problem. Imagine
that the LOB Application team has written a batch file that should be launched when the monitor you created enters
a warning state. You will create a task that can launch this cmd line (it needs to exist locally on the LOB application
you are monitoring).

Tasks Detailed Steps


Complete the following a. From the Health Model click Tasks | Agent Tasks.
task on: b. From the Actions pane, click New | Command Line Task (Probe Action).
c. Specify the information like this:
OpsMgrAuthoring
 Element ID = AuthoringConsole.MyFirstMP.Task
 Display Name = Fix LOB Application
1. Creating Tasks
 Target = AuthoringConsole.MyFirstMP.LOBApplication
 Category = Operations
d. Click Next.
e. Then configure the setting like this:
 Full path to file: c:\windows\system32\cmd.exe
 Parameters: /c c:\HOL-MPAuthoring\FixLOBApplication.cmd
f. Click Finish.
g. Lets next add some knowledge to our first monitor which name is:
AuthoringConsole.MyFirstMP.MonitorConnectionState
h. Open the monitor you created earlier and go to the Product knowledge tab and
choose Edit.
Note: Word opens.
i. In the Summary field, type This is the summary. A connection issue has
occurred based on event 201 being logged.
j. In the Resolutions field, type Try running the following task to fix the issue.
k. Click Task from the Link type drop-down.
l. Click Fix LOB Application from the Link drop-down.
m. Click Add Link.
n. Close Word.
o. When prompted to save, click Yes.
p. When done, the dialog should look something like the following:

Page 7 of 12
Building Management Packs with the Authoring Console
Tasks Detailed Steps

q. Click OK.

Page 8 of 12
Building Management Packs with the Authoring Console

Exercise 6
Creating Views to View the Health of a Windows Application

Scenario
Views are used to scope information to something specific like all alerts from exchange servers or all LOB
Applications and their state or events.

Tasks Detailed Steps


Complete the following a. Click the Presentation tab and then in the Presentation console select Views.
task on: b. Right-click in the views space and select New | Folder.
c. Make the Element id =
OpsMgrAuthoring AuthoringConsole.MyFirstMP.LOBApplication.ViewFolder and click OK.
d. On the General tab, enter LOB Application for the Name.
1. Creating Views e. Click the Folder tab and select the root folder.
f. Click OK.
g. Right-click in the views space and select New | State view.
h. Make the Element Id = AuthoringConsole.MyFirstMP.LOBApplicationState1
i. Then type LOB Application State as the Display Name.
j. In the Target field, choose AuthoringConsole.MyFirstMP.LOBApplication
k. Click Finish.
l. Right-click the new view and click Properties.
m. On the folder tab deselect the Root and select the folder you just created.
n. Click OK.
o. Click File | Save.

Page 9 of 12
Building Management Packs with the Authoring Console

Exercise 7
Testing a Management Pack from Operations Manager

Scenario
This section will show you how to test the management pack that you have created. For this section you will need a
management group running that you can test the management pack in with at least one server being monitored that
you have permissions to edit the registry on.

Tasks Detailed Steps


Complete the following a. Select Tools | Export to Management Group.
task on: b. Enter the name of a management server (red-dc-01) to connect to and click
Connect.
OpsMgrAuthoring c. Open an Operations Console for the management group you uploaded the MP to.
d. Ensure the management pack is present in the Management Pack view in the
1. Test the Administration space.
Management Pack
e. Click the Monitoring tab and then select LOB Application | LOB Application
State.
f. Click Start | Run. Type cmd and press Enter.
g. At the command prompt, type EventCreate /id 201 /t information /d Test and
press Enter.
h. Observe the state of the LOB Application instance goes unhealthy.
i. Right-click the LOB application Warning and select Open | Health Explorer for
Authoring Console.MyFirstMP.LOBApplication.
j. Click the LOB Application and review the resolutions.
k. Click Fix LOB Application and then click Run.
l. Observe the state of the LOB Application instance goes back to healthy.
m. Close the window and right-click the LOB Application instance and select Open |
Event View.
n. Switch back to command prompt and type the following EventCreate /id 101 /t
information /d Test. Press Enter.
o. Wait for the event to appear in the event view (you will have to refresh the view).

Page 10 of 12
Building Management Packs with the Authoring Console

Exercise 8
Adding Diagnostics and Recoveries for a Windows Application

Scenario
You can also add some tasks as diagnostics and recoveries. Since you have the Operations Console open you will do
this now from the Operations Console. You could also do this from the authoring console and that is the
recommended way to do it if you are building a MP that will be released to others as you have more control over the
names of objects. (remember if you do need to import a new MP always increment the version this will ensure you
send out the new version to agents).

Tasks Detailed Steps


Complete the following a. Click the Authoring tab and under Management Pack Objects, select Monitors.
task on: b. Click Scope on the toolbar.
c. In the search box type lob app and press Enter.
OpsMgrAuthoring
d. Expand LOB application | Entity health | Availability.
e. Right-click LOB Application connection state.
1. Diagnostics and
Recovery f. Click the Diagnostic and Recovery tab.
g. Click Add and select Diagnostic for warning health state.
h. Click Run Command and then click Next.
i. For Diagnostic name enter LOB Application Diagnostics and click Next.
j. For Full path to file enter C:\windows\system32\ipconfig.exe.
k. For parameters enter /all.
l. Click Create.
m. Click OK.
n. Switch to Command Prompt.
o. Type EventCreate /id 201 /t information /d Test and press Enter.
p. Switch to Operations Manager.
q. Browse to Monitoring | LOB Application | LOB Application State.
r. Right click the warning, point to Open and click Health Explorer.
s. Select the lowest level warning and in the results pane, click the State Change
Events tab.

Page 11 of 12
Building Management Packs with the Authoring Console

Page 12 of 12

Вам также может понравиться