Creating a management pack that will not roll up to computer health

I am trying to recreate a management pack that I had working.

I have been able to make a seed class and then monitor the application.  Both discoveries work but when the application goes unhealthy, so does the computer.

So I understand the best way to create this is to separate it with some form of abstract class.  But I am missing a few things in all of the instructions so here are my questions so far.

  • Do you run detections on the base abstract class?
  • Can you have a non-abstract seed not roll up

The MP I have created so far has the following:

MyApp.ComputerRole (abstract)

->MyApp.ApplicationComponent

->MyApp.Application

and a relationship that ties applicationcomponent to application.

My goal is to do this, Based on a registry setting on physical (not cluster names) populate a base class.  From that class detect the application running on a computer.  Then build monitors and views for it.

Daren

August 26th, 2015 8:58am

Hi

An abstract class won't help here.

Can I clarify - you are looking to do a registry based discovery of an unhosted class. E.g. Microsoft.Windows.ApplicationComponent

if so, I'll put something together. I'm doing an authoring series here - http://blogs.technet.com/b/manageabilityguys/ - and that sounds like a good addition.

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 10:02am

E.g.

<TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="GD.UnhostedApp.ClassAndDiscovery" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="false" Singleton="false">
          <Property ID="UniqueIdentifier" Key="true" Type="string" />
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="Discover.GD.UnhostedApp.ClassAndDiscovery" Target="Windows!Microsoft.Windows.Computer" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes />
        <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
          <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
          <RegistryAttributeDefinitions>
            <RegistryAttributeDefinition>
              <AttributeName>SeedExists</AttributeName>
              <Path>SOFTWARE\SCOMDiscoveryData\UnhostedClass</Path>
              <PathType>0</PathType>
              <AttributeType>0</AttributeType>
            </RegistryAttributeDefinition>
            <RegistryAttributeDefinition>
              <AttributeName>Key</AttributeName>
              <Path>SOFTWARE\SCOMDiscoveryData\UnhostedClass\Key</Path>
              <PathType>1</PathType>
              <AttributeType>1</AttributeType>
            </RegistryAttributeDefinition>
          </RegistryAttributeDefinitions>
          <Frequency>3600</Frequency>
          <ClassId>$MPElement[Name="GD.UnhostedApp.ClassAndDiscovery"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
                <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="GD.UnhostedApp.ClassAndDiscovery"]/UniqueIdentifier$</Name>
                <Value>$Data/Values/Key$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
          <Expression>
            <SimpleExpression>
              <ValueExpression>
                <XPathQuery Type="String">Values/SeedExists</XPathQuery>
              </ValueExpression>
              <Operator>Equal</Operator>
              <ValueExpression>
                <Value Type="String">True</Value>
              </ValueExpression>
            </SimpleExpression>
          </Expression>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="GD.UnhostedApp.ClassAndDiscovery">
          <Name>Unhosted Application</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString ElementID="GD.UnhostedApp.ClassAndDiscovery" SubElementID="UniqueIdentifier">
          <Name>Unique Identifer</Name>
          <Description></Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>

Disclaimer:
 All information is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk.

The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.

August 26th, 2015 10:35am

Just to add that as it is unhosted, it will need a key property.

Would you prefer it hosted by windows computer but not rolling up h

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 10:35am

Just to add that as it is unhosted, it will need a key property.

Would you prefer it hosted by windows computer but not rolling up h

August 26th, 2015 11:18am

Try the code above and see if it works the way you want it to.

If you do a new project and add an Empty Management Pack Fragment then you can copy and paste the above code in and just change the registry key and value.

It will discover a "local application" that isn't hosted by windows computer and health won't roll up.

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 11:25am

Well, I have the pack created but I am not seeing a discovered object.

So here is the class definition.

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="WSUS.Client.Management.Seed" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="false" Singleton="false">
          <Property ID="SubsystemName" Type="string" AutoIncrement="false" Key="true" CaseSensitive="false" MaxLength="5" MinLength="0" Required="false" Scale="0" />
          <Property ID="WindowsUpdateEnabled" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="5" MinLength="0" Required="false" Scale="0" />
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WSUS.Client.Management.Seed">
          <Name>Seed Class</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Seed" SubElementID ="SubsystemName">
          <Name>Subsystem Name</Name>
          <Description>Subsystem Name</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Seed" SubElementID ="WindowsUpdateEnabled">
          <Name>WSUS Enabled</Name>
          <Description>Shows if WSUS is enabled</Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

And here is the discovery script.  It should be noted that I am seeing the Event 998 properly filled out in the log.

Sub LogDebugEvent(EventNo,Message) 

    Message = VbCrLf & Message 
    If bDebug = 1 Then 
        Call oAPI.LogScriptEvent("WUAUDiscover.vbs",EventNo,EVENT_LEVEL_INFO,Message) 
    End If 
End Sub

SourceId = WScript.Arguments(0)
ManagedEntityId = WScript.Arguments(1)
sComputerName = WScript.Arguments(2)

bDebug=WScript.Arguments(3)

if (Wscript.Arguments.Count=4) Then
	isVirtualNode = "False"
	Else
	isVirtualNode ="True"
	end If

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
Set WshShell = WScript.CreateObject("WScript.Shell")

iUseWSUS = WshShell.RegRead("HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer")

LogDebugEvent 999, "Server " & sComputerName & " is virtual " & isVirtualNode & " and AU is set to " & iUseWSUS

if (isVirtualNode="False") Then
	if (iUseWSUS=1) Then 
		LogDebugEvent 998, "Server " & sComputerName & " should have an instance created."
		Set oInstance = oDiscoveryData.CreateClassInstance("$MPElement[Name='WSUS.Client.Management.Seed']$")
		oInstance.AddProperty "$MPElement[Name='WSUS.Client.Management.Seed']/SubsystemName$", sComputerName
		oInstance.AddProperty "$MPElement[Name='System!System.Entity']/DisplayName$", sComputerName
		oInstance.AddProperty "$MPElement[Name='WSUS.Client.Management.Seed']/WindowsUpdateEnabled$", "True"
		oDiscoveryData.AddInstance(oInstance)
		end If
	End If
oAPI.Return(oDiscoveryData)

But I still do not see any objects in SCOM.

August 26th, 2015 12:22pm

Just realized the discovery would be useful, too.

<!-- This file has been automatically generated.
     Any changes made to this file may be lost the next time it is regenerated. -->
<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Monitoring>
    <Discoveries>
      <Discovery ID="WSUS.Client.Management.WSUS.Client.Management.Seed" Target="Windows!Microsoft.Windows.Server.Computer" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes />
        <DataSource ID="Script.Discovery" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
          <!-- IntervalSeconds specifies how often we will run the discovery. -->
          <IntervalSeconds>14400</IntervalSeconds>
          <!-- SyncTime specifies the minutes after the hour to synchronize execution of the discovery. -->
          <SyncTime />
          <!-- ScriptName specifies the name of the script. -->
          <ScriptName>WUAUDiscover.vbs</ScriptName>
          <!-- Arguments specifies the arguments to pass into the script. -->
          <!-- A discovery script will always include $MPElement and $Target/ID$ in addition to any other values and variables the script requires. -->
          <Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ 1 $Target/Property[Type='Windows!Microsoft.Windows.Server.Computer']/IsVirtualNode$</Arguments>
          <!-- ScriptBody is the text of the script. In this case, a variable is used to specify the script file in the VSAE project -->
          <ScriptBody>$IncludeFileContent/Scripts/WUAUDiscover.vbs$</ScriptBody>
          <!-- TimeoutSeconds is the seconds that the script must be running before it is automatically ended. -->
          <TimeoutSeconds>300</TimeoutSeconds>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WSUS.Client.Management.WSUS.Client.Management.Seed">
          <Name>WSUS Client Seed Discovery</Name>
          <Description>Seed discovery of the WSUS client</Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 12:28pm

I'll try and find some time to review the code but I'm onsite with a customer for the next couple of days so it might be a little slow.

If you are happy to do a registry discovery then the first lot of code I posted will work for an unhosted class.

The following will work for an application that is hosted by windows computer but whose health does not roll up to windows computer (as there is no dependency roll up monitor):

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="GD.HostedLocalApp.Class" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false">
        </ClassType>
      </ClassTypes>

    <RelationshipTypes>
      <RelationshipType ID="Comp.Hosts.App" Base="System!System.Hosting" Abstract="false" Accessibility="Internal">
        <Source ID="Source" Type="Windows!Microsoft.Windows.Computer"/>
        <Target ID="Target" Type="GD.HostedLocalApp.Class"/>
      </RelationshipType>
    </RelationshipTypes>
    </EntityTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="Discover.GD.HostedLocalApp.ClassAndDiscovery" Target="Windows!Microsoft.Windows.Computer" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes />
        <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
          <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
          <RegistryAttributeDefinitions>
            <RegistryAttributeDefinition>
              <AttributeName>SeedExists</AttributeName>
              <Path>SOFTWARE\SCOMDiscoveryData\UnhostedClass</Path>
              <PathType>0</PathType>
              <AttributeType>0</AttributeType>
            </RegistryAttributeDefinition>
          </RegistryAttributeDefinitions>
          <Frequency>3600</Frequency>
          <ClassId>$MPElement[Name="GD.HostedLocalApp.Class"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
                <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
          <Expression>
            <SimpleExpression>
              <ValueExpression>
                <XPathQuery Type="String">Values/SeedExists</XPathQuery>
              </ValueExpression>
              <Operator>Equal</Operator>
              <ValueExpression>
                <Value Type="String">True</Value>
              </ValueExpression>
            </SimpleExpression>
          </Expression>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="GD.HostedLocalApp.Class">
          <Name>Hosted Application no health roll up</Name>
          <Description></Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

August 26th, 2015 1:17pm

For your script discovery - do you see any errors e.g. 10801 errors in the OperationsManager event log on your Management Servers?
Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 1:24pm

For your script discovery - do you see any errors e.g. 10801 errors in the OperationsManager event log on your Managemen
August 26th, 2015 1:36pm

For your script discovery - do you see any errors e.g. 10801 errors in the OperationsManager event log on your Management Serv

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 1:39pm

With script based discoveries, if there is a problem with the script then you usually see it in the agent log. If there is a problem with the format then it is generally the Management Server.

Out of interest - is there a reason for choosing a script based discovery rather than a registry discovery? The latter is a lot less performance intensive

August 26th, 2015 2:02pm

With script based discoveries, if there is a problem with the script then you usually see it in the agent log. If there is a problem with the format then it is generally the Management Server.

Out of interest - is there a reason for choosing a script based discovery rather than a registry discovery? The latter is a lot less performance int

Free Windows Admin Tool Kit Click here and download it now
August 26th, 2015 3:07pm

Thank you for the help as I have made great progress.

I have migrated my old monitors that worked and attempted integration into the current model.  However, I see the initial state of healthy status but cannot get the timed scripts to run against this unhosted object.  No error messages about script errors, just no reaction seemingly at all.

Daren

P.S. Here is the configuration of the monitor (less script code).  WSUS.Client.Management.Application is the class being properly detected.

			<UnitMonitor ID="WSUS.Client.Management.Monitor.WSUS.Client.Application.Pending.Reboot" Accessibility="Public" Enabled="true" Target="WSUS.Client.Management.Application" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.TimedScript.TwoStateMonitorType" ConfirmDelivery="false">
				<Category>AvailabilityHealth</Category>
				<OperationalStates>
					<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"></OperationalState>
					<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"></OperationalState>
				</OperationalStates>
				<Configuration>
					<IntervalSeconds>900</IntervalSeconds>
					<SyncTime></SyncTime>
					<ScriptName>WUAURebootStatus.vbs</ScriptName>
					<Arguments>1</Arguments>
					<ScriptBody></ScriptBody>
					<SecureInput></SecureInput>
					<TimeoutSeconds>300</TimeoutSeconds>
					<ErrorExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">RebootRequired</Value>
							</ValueExpression>
						</SimpleExpression>
					</ErrorExpression>
					<SuccessExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">OK</Value>
							</ValueExpression>
						</SimpleExpression>
					</SuccessExpression>
				</Configuration>
			</UnitMonitor>


August 27th, 2015 8:00am

A couple of things - have to be quick as I'm on lunch ;-)

1. In general, targetting an unhosted class won't make any difference to targeting an unhosted class. Is there anything in the script that might be specific to the previously targeted class and that isn't being passed properly for the new class?

2. Try inserting some code into the script that will log events as it executes, ideally passing parameters along the way. This will confirm that the script is actually running and what data it is processing.

3. If you want to sanity check monitoring of the unhosted class, just create a unit monitor for the spooler service against it and stop the spooler service. It will work. I suspect that it will be something in the script or the targeting.

Let us know how you get on. I'll check again this evening when I get in.

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 8:43am

A couple of things - have to be quick as I'm on lunch ;-)

1. In general, targetting an unhosted class won't make any difference to targeting an unhosted class. Is there anything in the script that might be specific to the previously targeted class and that isn't being passed properly for the new class?

2. Try inserting some code into the script that will log events as it executes, ideally passing parameters along the way. This will confirm that the script is actually running and what data it is processing.

3. If you want to sanity check monitoring of the unhosted class, just create a unit monitor for the spooler service against it and stop the spooler service. It will work. I suspect that it will be something in the script or the targeting.

Let us know how you get on. I'll check again this evening when I get in.

Cheers

August 27th, 2015 8:47am

The only place these monitors are running are on the management servers.  Is there something about unhosted classes only being managed on the MS computers?

Daren

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 8:56am

Have you made them a singleton?
August 27th, 2015 9:00am

No, I guess it should be, there will not be more than one instance ever.  Will this help, right now it is set to false.

I found this link that talks more about unhosted classes that seem to mimic what I see.  Somehow I have to make this run on the client health agents.

Daren

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 9:02am

Yep - makes sense. Can you make it hosted by windows computer as below with the relationship. The lack of a dependency roll up will stop health rolling up.

  <TypeDefinitions>
   
<EntityTypes>
     
<ClassTypes>
       
<ClassType ID="GD.HostedLocalApp.Class" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false">
       
</ClassType>
     
</ClassTypes>

   
<RelationshipTypes>
     
<RelationshipType ID="Comp.Hosts.App" Base="System!System.Hosting" Abstract="false" Accessibility="Internal">
       
<Source ID="Source" Type="Windows!Microsoft.Windows.Computer"/>
       
<Target ID="Target" Type="GD.HostedLocalApp.Class"/>
     
</RelationshipType>
   
</RelationshipTypes>
   
</EntityTypes>
 
</TypeDefinitions>

August 27th, 2015 9:04am

Will try this.
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 9:06am

Ok, this resulted in another error, I had to put back in the discovery this line.

  oInstance.AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", sComputerName

But now nothing is being discovered or even tried that I can tell.

Class

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="WSUS.Client.Management.Application" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false">
          <Property ID="SubsystemName" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="100" MinLength="0" Required="false" Scale="0" />
          <Property ID="WindowsUpdateEnabled" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="5" MinLength="0" Required="false" Scale="0" />
          <Property ID="WindowsServer" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="WindowsStatusServer" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="TargetGroupEnabled" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="TargetGroupName" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="AUOptions" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="InstallTOD" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
          <Property ID="InstallDOW" Type="string" AutoIncrement="false" Key="false" CaseSensitive="false" MaxLength="256" MinLength="0" Required="false" Scale="0" />
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WSUS.Client.Management.Application">
          <Name>WSUS Client Application</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID ="SubsystemName">
          <Name>Subsystem Name</Name>
          <Description>Subsystem Name</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID ="WindowsUpdateEnabled">
          <Name>WSUS Enabled</Name>
          <Description>Shows if WSUS is enabled</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="WindowsServer">
          <Name>WindowsServer</Name>
          <Description>Windows Update Server</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="WindowsStatusServer">
          <Name>WindowsStatusServer</Name>
          <Description>Windows Update Status/Reports Server</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="TargetGroupEnabled">
          <Name>TargetGroupEnabled</Name>
          <Description>Client Based Targeting Status</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="TargetGroupName">
          <Name>TargetGroupName</Name>
          <Description>Client Based Targeting Group</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="AUOptions">
          <Name>AUOptions</Name>
          <Description>Automatic Update Setting</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="InstallTOD">
          <Name>InstallTOD</Name>
          <Description>Installation Day</Description>
        </DisplayString>
        <DisplayString ElementID="WSUS.Client.Management.Application" SubElementID="InstallDOW">
          <Name>InstallDOW</Name>
          <Description>Installation Time</Description>
        </DisplayString>

      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

The Relationship

<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TypeDefinitions>
    <EntityTypes>
      <RelationshipTypes>
        <RelationshipType ID="WSUS.Client.Management.Relationship" Base="System!System.Hosting" Abstract="false" Accessibility="Internal">
          <Source ID="Source" Type="Windows!Microsoft.Windows.Computer"/>
          <Target ID="Target" Type="WSUS.Client.Management.Application"/>
        </RelationshipType>
        
      </RelationshipTypes>
    </EntityTypes>
  </TypeDefinitions>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WSUS.Client.Management.Relationship">
          <Name>WSUS Relationship to Parent OS</Name>
          <Description></Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

and the discovery...

<!-- This file has been automatically generated.
     Any changes made to this file may be lost the next time it is regenerated. -->
<ManagementPackFragment SchemaVersion="2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Monitoring>
    <Discoveries>
      <Discovery ID="WSUS.Client.Management.WSUS.Client.Management.Application.Discovery" Target="Windows!Microsoft.Windows.Server.Computer" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes />
        <DataSource ID="Script.Discovery" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
          <!-- IntervalSeconds specifies how often we will run the discovery. -->
          <IntervalSeconds>14400</IntervalSeconds>
          <!-- SyncTime specifies the minutes after the hour to synchronize execution of the discovery. -->
          <SyncTime />
          <!-- ScriptName specifies the name of the script. -->
          <ScriptName>WUAUDiscover.vbs</ScriptName>
          <!-- Arguments specifies the arguments to pass into the script. -->
          <!-- A discovery script will always include $MPElement and $Target/ID$ in addition to any other values and variables the script requires. -->
          <Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ 1 $Target/Property[Type='Windows!Microsoft.Windows.Server.Computer']/IsVirtualNode$</Arguments>
          <!-- ScriptBody is the text of the script. In this case, a variable is used to specify the script file in the VSAE project -->
          <ScriptBody>$IncludeFileContent/Service/Scripts/WUAUDiscover.vbs$</ScriptBody>
          <!-- TimeoutSeconds is the seconds that the script must be running before it is automatically ended. -->
          <TimeoutSeconds>300</TimeoutSeconds>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="WSUS.Client.Management.WSUS.Client.Management.Application.Discovery">
          <Name>WSUS Client Discovery</Name>
          <Description>Seed discovery of the WSUS client</Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

August 27th, 2015 10:10am

Thank you for the help as I have made great progress.

I have migrated my old monitors that worked and attempted integration into the current model.  However, I see the initial state of healthy status but cannot get the timed scripts to run against this unhosted object.  No error messages about script errors, just no reaction seemingly at all.

Daren

P.S. Here is the configuration of the monitor (less script code).  WSUS.Client.Management.Application is the class being properly detected.

			<UnitMonitor ID="WSUS.Client.Management.Monitor.WSUS.Client.Application.Pending.Reboot" Accessibility="Public" Enabled="true" Target="WSUS.Client.Management.Application" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.TimedScript.TwoStateMonitorType" ConfirmDelivery="false">
				<Category>AvailabilityHealth</Category>
				<OperationalStates>
					<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"></OperationalState>
					<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"></OperationalState>
				</OperationalStates>
				<Configuration>
					<IntervalSeconds>900</IntervalSeconds>
					<SyncTime></SyncTime>
					<ScriptName>WUAURebootStatus.vbs</ScriptName>
					<Arguments>1</Arguments>
					<ScriptBody></ScriptBody>
					<SecureInput></SecureInput>
					<TimeoutSeconds>300</TimeoutSeconds>
					<ErrorExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">RebootRequired</Value>
							</ValueExpression>
						</SimpleExpression>
					</ErrorExpression>
					<SuccessExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">OK</Value>
							</ValueExpression>
						</SimpleExpression>
					</SuccessExpression>
				</Configuration>
			</UnitMonitor>


Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 11:58am

Thank you for the help as I have made great progress.

I have migrated my old monitors that worked and attempted integration into the current model.  However, I see the initial state of healthy status but cannot get the timed scripts to run against this unhosted object.  No error messages about script errors, just no reaction seemingly at all.

Daren

P.S. Here is the configuration of the monitor (less script code).  WSUS.Client.Management.Application is the class being properly detected.

			<UnitMonitor ID="WSUS.Client.Management.Monitor.WSUS.Client.Application.Pending.Reboot" Accessibility="Public" Enabled="true" Target="WSUS.Client.Management.Application" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.TimedScript.TwoStateMonitorType" ConfirmDelivery="false">
				<Category>AvailabilityHealth</Category>
				<OperationalStates>
					<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"></OperationalState>
					<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"></OperationalState>
				</OperationalStates>
				<Configuration>
					<IntervalSeconds>900</IntervalSeconds>
					<SyncTime></SyncTime>
					<ScriptName>WUAURebootStatus.vbs</ScriptName>
					<Arguments>1</Arguments>
					<ScriptBody></ScriptBody>
					<SecureInput></SecureInput>
					<TimeoutSeconds>300</TimeoutSeconds>
					<ErrorExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">RebootRequired</Value>
							</ValueExpression>
						</SimpleExpression>
					</ErrorExpression>
					<SuccessExpression>
						<SimpleExpression>
							<ValueExpression>
								<XPathQuery Type="String">Property[@Name='State']</XPathQuery>
							</ValueExpression>
							<Operator>Equal</Operator>
							<ValueExpression>
								<Value Type="String">OK</Value>
							</ValueExpression>
						</SimpleExpression>
					</SuccessExpression>
				</Configuration>
			</UnitMonitor>


August 27th, 2015 11:58am

I've posted some code up here.

Classes:

GD.HR.ApplicationServer = Seed class, LocalApplication - Registry Based Discovery

GD.HR.ApplicationServer.FailedQueue - ApplicationComponent - PowerShell Script Discovery

GD.HR.ApplicationServer.ProcessQueue - ApplicationComponent - VBScript Discovery

The script discoveries look for folders in:

c:\vsexample\failedqueue

c:\vsexample\processqueue

Seed Class:

Failed Queue

Process Queue

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 3:00pm

Thank you Graham.

I have been able to recreate my management pack.  I have also learned a lot.

Working on some presentation views now.

Daren Daigle

Boys and Girls Clubs of America

August 28th, 2015 8:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics