Simple MP question
Home  » MP Development  » Simple MP question

Simple MP question
Posted: Thu, Feb 04, 2010 7:25 AM :: Rank: 2
Author
Points: 876
Level: System Center Hero

I've been creating a management pack, following bits of various guides and doing some stuff with the MP authoring console and some with wizards and then editing and copying the relevant XML,

Basically I am discovering the relevant machines that have a specific service running as a specific account, (there are three servers running the service, Live, System Test and Dev) Each runs using a seperate service account, so my discovery is based on a WMI query to achieve this.

Currently the Source of the alert is the service name, but I'd rather this was the server name.. Im sure its simple to sort but Im struggling now with this.. any suggestions: some snippets of code:

    <EntityTypes>
      <ClassTypes>
        <ClassType ID="xxx.xxx.xxx.xxx.Service" Accessibility="Internal" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false">
          <Property ID="StartName" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
        </ClassType>

</ClassTypes>
    </EntityTypes>

  <Monitoring>
    <Discoveries>
      <Discovery ID="xxx.xxx.xxx.xxx.xxx.Discovery" Enabled="true" Target="Windows!Microsoft.Windows.Server.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="xxx.xxx.xxx.xxx.Service">
        <Property PropertyID="StartName" />
   <Property TypeID="System!System.Entity" PropertyID="DisplayName" />
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
          <NameSpace>\\$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$\ROOT\CIMV2</NameSpace>
          <Query>Select * from Win32_Service where name= 'xxx'and StartName = xxx\\xxx_Test</Query>
          <Frequency>600</Frequency>
          <ClassId>$MPElement[Name="xxx.xxx.xxx.xxx.Service"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="Callcredit.CallMonitor.AutoDelivery.Stream3.Service"]/StartName$</Name>
                <Value>$Data/Property[@Name='StartName']$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
        </DataSource>
      </Discovery>

    </Discoveries> 

I've been pissing about with startname and priciple name but still not sussed it out..

 Cheers

David

   Report Abuse
Re: Simple MP question
Posted: Thu, Feb 04, 2010 9:20 AM :: Rank: 3
Author
Points: 1372
Level: System Center Specialist

David

The source of an alert will always contain the display name of the object. But you can include the computer name which hosts your custom service in the alert text. Just add the following alert parameter:

$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/PrincipalName$

If you must include the server's name in the alert source, you could include it in your display name during discovery. Something along the line of this:

<Setting>

<Name>$MPElement[Name='System!System.Entity']/DisplayName$</Name>
<Value>$Target/Property[Type='Windows!Microsoft.Windows.Computer']/PrincipalName$: $Data/Property[@Name='StartName']$</Value>

</Setting>





Raphael

   Report Abuse
Re: Simple MP question
Posted: Thu, Feb 04, 2010 9:24 AM :: Rank: 3
Author
Points: 876
Level: System Center Hero
I know that I can use this to do it.. What I am struggling with is where I actually put it! because everything I have tried doesnt work!
   Report Abuse
RE: Simple MP question
Posted: Thu, Feb 04, 2010 10:24 AM :: Rank: 6
Author
Points: 1372
Level: System Center Specialist

>Settings>Setting>Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>Value$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>Setting>Setting>Name$MPElement[Name="Callcredit.CallMonitor.AutoDelivery.Stream3.Service"]/StartName$</Name>Value$Data/Property[@Name='StartName']$</Value>Setting>Setting>Name>$MPElement[Name="System!System.Entity"]/DisplayName $</Name>Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$: $Data/Property[@Name='StartName']$</Value>Setting>Settings>InstanceSettings>

 

In the authoring console it would also go into the InstanceSettings under the Configuration tab.

 

To define the display name during discovery, just add it to the <InstanceSettings> of your disocvery. That would then look like this (better download the attachment):

InstanceSettings

   Report Abuse

Home  » MP Development  » Simple MP question
Tag Cloud
Quick Links
Top Contributors
Featured Members
Pete Zerger
Points: 41211
Level: System Center Expert
Simon Skinner
Points: 30429
Level: System Center Expert
Tommy Gunn
Points: 29964
Level: System Center Expert
Stefan Koell
Points: 20109
Level: System Center Expert
Tenchuu
Points: 15261
Level: System Center Expert