The following procedures explain how to create classes in a management pack using both the Operations Manager 2007 Authoring Console and Visual Studio Authoring Extensions. This exercise is part of the System Center Operations Manager Management Pack Authoring Center.
This exercise applies to the following products:
Before you perform this procedure, you must first complete the following prerequisite procedures:
The Microsoft System Center team has validated this procedure as of revision #4. We will continue to review any changes and periodically provide validations on later revisions as they are made. Please feel free to make any corrections or additions to this procedure that you think would assist other users
A sample of the completed code for each exercise is available in the TechNet Gallery. There is a separate sample for each exercise that includes the management pack completed at the end of that exercise and each preceding exercise. This strategy allows you to work through each exercise in order and then compare your results. For VSAE, this also includes the Visual Studio solution.
The classes created in the following procedures have the following characteristics:
<
ClassType
ID
=
"MyMP.MyComputerRoleBase"
Base
"Windows!Microsoft.Windows.ComputerRole"
Accessibility
"Internal"
Abstract
"true"
Hosted
Singleton
"false"
>
Property
"Version"
Key
Type
"string"
/>
</
DisplayString
ElementID
Name
>My Computer Role Base</
Description
></
SubElementID
>Version</
"MyMP.MyComputerRole1"
"MyMP.MyComputerRole2"
>My Computer Role 1</
>My Computer Role 2</
"MyMP.MyApplicationComponent"
"Windows!Microsoft.Windows.ApplicationComponent"
"ComponentName"
RelationshipTypes
RelationshipType
"MyMP.MyComputerRole1HostsMyApplicationComponent"
"System!System.Hosting"
Source
"Source"
Target
"Target"
>My Application Component</
>My Computer Role Hosts My Application Component</
Tom_Riddle edited Revision 8. Comment: update "Creating a new MP " link to proper location.
Richard Mueller edited Revision 7. Comment: Replaced RGB values with color names in HTML to restore colors
Richard Mueller edited Revision 6. Comment: Fixed duplicate <a name> tags in HTML so TOC works properly, added tags, Removed (en-US) from title
Brian,
in the authoring console section of this page, step 4b changes the id to "ComponentName." but the word "ComponentName" does not appear in the VSAE instructions on this page. i think this is breaking the vbscript in exercise 6 for VSAE, which is looking for "ComponentName."
Thanks for spotting that Job. You're absolutely correct about my error. It's correct in the download in the TechNet Gallery, but the XML is not correct here. You need to have a key property for MyApplicationComponent since we are expecting multiple instances of it on a single agent. That is what is breaking Exercise 6. I'm fixing it now.
1. in the application component section, step 3, why are we "Replacing" the Displaystring entry with new xml rather than just inserting a new Displaystring entry at the end of the Displaystrings section?
2. why/how does VS still successfully build the mpx if we remove all the Displaystrings except the applciation component one? are Display Strings for the base class, abstract classes, and application component not required?
Something is weird with the comment notification because I just got the mail that there was a new comment. In any event, sorry for the late reply.
1. You can tell that I did a copy/paste from the previous section. Sorry about that. Should read "Add the following XML..." I'll fix that.
2. Display strings are never required. If a display string isn't provided for an element, then the Ops Console will use the ID of the element instead. Obviously, the best practice is to give all elements a display string.