question

MaksC avatar image
0 Votes"
MaksC asked MaksC commented

Custom WMI Descovery rule for _Total Hyper-V logical processor counter doesn't work

Hello.

How I can make it right?
I created MP for monitoring _Total counter of Hyper-V Logical Processor instanse in perfmon. But WMI Descovery rule doesn't work and I don't get instans of my custom class that represent "_Total" counter. I enable that descovery by override for chosen Hyper-V server. But only geting error 10409 on scom server:

Object enumeration failed

Query: 'SELECT Name FROM Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor WHERE Name='_Total''

HRESULT: 0x80041010
Details: Invalid class

One or more workflows were affected by this.

Workflow name: Custom.HyperV2012R2.LogicalProcessor.Total.Discovery
Instance name: %scom server FQDN%
Instance ID: {%SCOM server ID%}
Management group: %Management Group Name%


My management pack:

 <?xml version="1.0" encoding="utf-8"?>
 <ManagementPack SchemaVersion="2.0" ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <Manifest>
     <Identity>
       <ID>MP.Custom.HyperV.2012R2</ID>
       <Version>1.0.0.7</Version>
     </Identity>
     <Name>Custom Hyper-V 2012R2 MP</Name>
     <References>
       <Reference Alias="SCDW">
         <ID>Microsoft.SystemCenter.DataWarehouse.Library</ID>
         <Version>7.1.10226.0</Version>
         <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
       </Reference>
       <Reference Alias="SC">
         <ID>Microsoft.SystemCenter.Library</ID>
         <Version>7.0.8433.0</Version>
         <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
       </Reference>
       <Reference Alias="Windows">
         <ID>Microsoft.Windows.Library</ID>
         <Version>7.5.8501.0</Version>
         <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
       </Reference>
       <Reference Alias="System">
         <ID>System.Library</ID>
         <Version>7.5.8501.0</Version>
         <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
       </Reference>
       <Reference Alias="Performance">
         <ID>System.Performance.Library</ID>
         <Version>7.0.8433.0</Version>
         <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
       </Reference>
     </References>
   </Manifest>
   <TypeDefinitions>
     <EntityTypes>
       <ClassTypes>
         <ClassType ID="Custom.HyperV2012R2.LogicalProcessor.Total" Accessibility="Public" Base="System!System.Entity" Abstract="false" Hosted="false" Singleton="false" Extension="false">
           <Property ID="Name" Type="string" AutoIncrement="false" Key="true" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
         </ClassType>
       </ClassTypes>
     </EntityTypes>
   </TypeDefinitions>
   <Monitoring>
     <Discoveries>
       <Discovery ID="Custom.HyperV2012R2.LogicalProcessor.Total.Discovery" Enabled="false" Target="Windows!Microsoft.Windows.Server.Computer" ConfirmDelivery="false" Remotable="false" Priority="Normal">
         <Category>Discovery</Category>
         <DiscoveryTypes>
           <DiscoveryClass TypeID="Custom.HyperV2012R2.LogicalProcessor.Total">
             <Property PropertyID="Name" />
             <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 Name FROM Win32_PerfFormattedData_HvStats_HyperVHypervisorLogicalProcessor WHERE Name='_Total'</Query>
           <Frequency>43200</Frequency>
           <ClassId>$MPElement[Name="Custom.HyperV2012R2.LogicalProcessor.Total"]$</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="Custom.HyperV2012R2.LogicalProcessor.Total"]/Name$</Name>
                 <Value>$Data/Property[@Name='Name']$</Value>
               </Setting>
             </Settings>
           </InstanceSettings>
         </DataSource>
       </Discovery>
     </Discoveries>
     <Rules>
       <Rule ID="Custom.HyperV2012R2.LogicalProcessor.Total.TotalUtilization.Counter.Rule" Enabled="false" Target="Custom.HyperV2012R2.LogicalProcessor.Total" ConfirmDelivery="false" Remotable="false" Priority="Normal" DiscardLevel="100">
         <Category>PerformanceCollection</Category>
         <DataSources>
           <DataSource ID="System.Performance.OptimizedDataProvider" TypeID="Performance!System.Performance.OptimizedDataProvider">
             <ComputerName>.</ComputerName>
             <CounterName>% Total Run Time</CounterName>
             <ObjectName>Hyper-V Hypervisor Logical Processor</ObjectName>
             <InstanceName>_Total</InstanceName>
             <AllInstances>false</AllInstances>
             <Frequency>300</Frequency>
             <Tolerance>1</Tolerance>
             <ToleranceType>Absolute</ToleranceType>
             <MaximumSampleSeparation>10</MaximumSampleSeparation>
           </DataSource>
         </DataSources>
         <WriteActions>
           <WriteAction ID="Microsoft.SystemCenter.CollectPerformanceData" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" />
           <WriteAction ID="Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData" />
         </WriteActions>
       </Rule>
     </Rules>
   </Monitoring>
   <LanguagePacks>
     <LanguagePack ID="ENU" IsDefault="true">
       <DisplayStrings>
         <DisplayString ElementID="Custom.HyperV2012R2.LogicalProcessor.Total">
           <Name>Custom Hyper-V 2012 R2 Logical Processor Total Object</Name>
           <Description>Represent object for _Total Logical Processor Utilization Counter</Description>
         </DisplayString>
         <DisplayString ElementID="Custom.HyperV2012R2.LogicalProcessor.Total.Discovery">
           <Name>Custom HyperV2012R2 LogicalProcessor Total Discovery</Name>
           <Description>Discovery Rule Cusom Hyper-V 2012 R2 Logical Processor Total Object</Description>
         </DisplayString>
         <DisplayString ElementID="Custom.HyperV2012R2.LogicalProcessor.Total.TotalUtilization.Counter.Rule">
           <Name>Custom Hyper-V 2012 R2 Logical Processor Total Total Utilization Counter Rule</Name>
           <Description>Rule for Hyper-V Hypervisor Logical Processor _Total Counter in PerfMon</Description>
         </DisplayString>
         <DisplayString ElementID="Custom.HyperV2012R2.LogicalProcessor.Total" SubElementID="Name">
           <Name>Name</Name>
           <Description>Total Logical Processor Counter</Description>
         </DisplayString>
         <DisplayString ElementID="MP.Custom.HyperV.2012R2">
           <Name>Custom Hyper-V 2012R2 MP</Name>
           <Description>Пакет для мониторинга Hyper-V</Description>
         </DisplayString>
       </DisplayStrings>
       <KnowledgeArticles></KnowledgeArticles>
     </LanguagePack>
   </LanguagePacks>
 </ManagementPack>






msc-operations-managerwindows-server-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CyrAz avatar image
0 Votes"
CyrAz answered MaksC commented

How exactly did you do your override to enable that discovery for hyperv servers?

From the error you get, the discovery rule is running on the SCOM Management and is obviously failing since that counter doesn't exist except on HyperV servers.

On a side note, why are you using such a discovery? Wouldn't it be easier to simply import the HyperV MP and to target the perf rule at the HyperV Server class?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your reply.

0 Votes 0 ·

I did select "override for a specific object of class: Windows Server" and select Hyper-V host from the list.
I setting up one rule attached to Hyper-V servers class - but it didn't help me with my problem:
Maybe I wrong undestend what really I need: I use Squaredup dashboard and that one load data from data warehouse. I know about problem of data warehouse store data from performance rule: somthing like "one object - one rule" and if you have several rules - only one can store data to warehouse database. But now I think it's not "one object - one rule" but "one counter - one rule":
I did check data in dbo.PerfRow_###... tables by ManagedEntityRowId. But now I checked table dbo.PerformanceRule - and see only one rule, but not my. Rule from Hyper-V Management Pack Extensions 2012R2 work fine - but it's counter for each LP (HV LP 0,1,2,) but not _Total - and data from that rule I can see in Squered up dashboard. How I can make that for my rule?

0 Votes 0 ·
 SELECT * FROM [OperationsManagerDW].[dbo].[PerformanceRule]
 WHERE CounterName='% Total Run Time'
0 Votes 0 ·