<ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>Custom.WebsiteWatcher.Library</ID>
      <Version>1.0.0.5</Version>
    </Identity>
    <Name>Custom.WebsiteWatcher.Library</Name>
    <References>
      <Reference Alias="SC">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>6.0.6278.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>6.0.6278.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Health">
        <ID>System.Health.Library</ID>
        <Version>6.0.6278.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>6.0.6278.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="MicrosoftSystemCenterWebApplicationLibrary">
        <ID>Microsoft.SystemCenter.WebApplication.Library</ID>
        <Version>6.0.6278.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="Custom.WebsiteWatcher.Library.SCCMMP" Accessibility="Public" Abstract="false" Base="System!System.Perspective" Hosted="true" Singleton="false">
          <Property ID="URL" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
        </ClassType>
        <ClassType ID="Custom.WebsiteWatcher.Library.POS" Accessibility="Public" Abstract="false" Base="System!System.Perspective" Hosted="true" Singleton="false">
          <Property ID="URL" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
        </ClassType>
        <ClassType ID="Custom.WebsiteWatcher.Library.StoreInv" Accessibility="Public" Abstract="false" Base="System!System.Perspective" Hosted="true" Singleton="false">
          <Property ID="URL" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
        </ClassType>
      </ClassTypes>
      <RelationshipTypes>
        <RelationshipType ID="Custom.WebsiteWatcher.Library.SCCMMPPerspective" Accessibility="Public" Abstract="false" Base="System!System.Hosting">
          <Source>Windows!Microsoft.Windows.Computer</Source>
          <Target>Custom.WebsiteWatcher.Library.SCCMMP</Target>
        </RelationshipType>
        <RelationshipType ID="Custom.WebsiteWatcher.Library.POSPerspective" Accessibility="Public" Abstract="false" Base="System!System.Hosting">
          <Source>Windows!Microsoft.Windows.Computer</Source>
          <Target>Custom.WebsiteWatcher.Library.POS</Target>
        </RelationshipType>
        <RelationshipType ID="Custom.WebsiteWatcher.Library.StoreInvPerspective" Accessibility="Public" Abstract="false" Base="System!System.Hosting">
          <Source>Windows!Microsoft.Windows.Computer</Source>
          <Target>Custom.WebsiteWatcher.Library.StoreInv</Target>
        </RelationshipType>
      </RelationshipTypes>
    </EntityTypes>
    <ModuleTypes>
      <DataSourceModuleType ID="Custom.WebsiteWatcher.Library.URLProbe" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="URLPath" type="xsd:string" />
          <xsd:element minOccurs="1" name="Interval" type="xsd:integer" />
        </Configuration>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
                <Scheduler>
                  <SimpleReccuringSchedule>
                    <Interval>$Config/Interval$</Interval>
                  </SimpleReccuringSchedule>
                  <ExcludeDates />
                </Scheduler>
              </DataSource>
              <ProbeAction ID="Probe" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.UrlProbe">
                <Proxy />
                <ProxyUserName />
                <ProxyPassword />
                <ProxyAuthenticationScheme>None</ProxyAuthenticationScheme>
                <CredentialUserName />
                <CredentialPassword />
                <AuthenticationScheme>None</AuthenticationScheme>
                <FollowRedirects>true</FollowRedirects>
                <RetryCount>0</RetryCount>
                <RequestTimeout>0</RequestTimeout>
                <Requests>
                  <Request>
                    <RequestID>1</RequestID>
                    <URL>$Config/URLPath$</URL>
                    <Verb>GET</Verb>
                    <Version>HTTP/1.1</Version>
                    <HttpHeaders>
                      <HttpHeader>
                        <Name>User-Agent</Name>
                        <Value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)</Value>
                      </HttpHeader>
                    </HttpHeaders>
                    <Body />
                    <CheckContentChange>false</CheckContentChange>
                    <ContentHash>00000000-0000-0000-0000-000000000000</ContentHash>
                    <Depth>0</Depth>
                    <ThinkTime>0</ThinkTime>
                    <CheckInternalLinks>false</CheckInternalLinks>
                    <CheckExternalLinks>false</CheckExternalLinks>
                    <CheckResources>true</CheckResources>
                    <RequestEvaluationCriteria>
                      <StopProcessingIfWarningCriteriaIsMet>false</StopProcessingIfWarningCriteriaIsMet>
                      <StopProcessingIfErrorCriteriaIsMet>false</StopProcessingIfErrorCriteriaIsMet>
                      <BasePageEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria>
                          <NumericCriteriaExpressions>
                            <NumericCriteriaExpression>
                              <NumericRequestMetric>BasePageData/StatusCode</NumericRequestMetric>
                              <Operator>GreaterEqual</Operator>
                              <Value>400</Value>
                            </NumericCriteriaExpression>
                          </NumericCriteriaExpressions>
                        </ErrorCriteria>
                      </BasePageEvaluationCriteria>
                      <LinksEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </LinksEvaluationCriteria>
                      <ResourcesEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </ResourcesEvaluationCriteria>
                      <WebPageTotalEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </WebPageTotalEvaluationCriteria>
                      <DepthEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </DepthEvaluationCriteria>
                    </RequestEvaluationCriteria>
                    <FormsAuthCredentials />
                  </Request>
                </Requests>
              </ProbeAction>
            </MemberModules>
            <Composition>
              <Node ID="Probe">
                <Node ID="Scheduler" />
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.WebApplicationData</OutputType>
      </DataSourceModuleType>
      <DataSourceModuleType ID="Custom.WebsiteWatcher.Library.ContentMatch" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="URLPath" type="xsd:string" />
          <xsd:element minOccurs="1" name="Interval" type="xsd:integer" />
          <xsd:element minOccurs="1" name="Phrase" type="xsd:string" />
        </Configuration>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
                <Scheduler>
                  <SimpleReccuringSchedule>
                    <Interval>$Config/Interval$</Interval>
                  </SimpleReccuringSchedule>
                  <ExcludeDates />
                </Scheduler>
              </DataSource>
              <ProbeAction ID="Probe" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.UrlProbe">
                <Proxy />
                <ProxyUserName />
                <ProxyPassword />
                <ProxyAuthenticationScheme>None</ProxyAuthenticationScheme>
                <CredentialUserName />
                <CredentialPassword />
                <AuthenticationScheme>None</AuthenticationScheme>
                <FollowRedirects>true</FollowRedirects>
                <RetryCount>0</RetryCount>
                <RequestTimeout>0</RequestTimeout>
                <Requests>
                  <Request>
                    <RequestID>1</RequestID>
                    <URL>$Config/URLPath$</URL>
                    <Verb>GET</Verb>
                    <Version>HTTP/1.1</Version>
                    <HttpHeaders>
                      <HttpHeader>
                        <Name>User-Agent</Name>
                        <Value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)</Value>
                      </HttpHeader>
                    </HttpHeaders>
                    <Body />
                    <CheckContentChange>false</CheckContentChange>
                    <ContentHash>00000000-0000-0000-0000-000000000000</ContentHash>
                    <Depth>0</Depth>
                    <ThinkTime>0</ThinkTime>
                    <CheckInternalLinks>false</CheckInternalLinks>
                    <CheckExternalLinks>false</CheckExternalLinks>
                    <CheckResources>false</CheckResources>
                    <RequestEvaluationCriteria>
                      <StopProcessingIfWarningCriteriaIsMet>false</StopProcessingIfWarningCriteriaIsMet>
                      <StopProcessingIfErrorCriteriaIsMet>false</StopProcessingIfErrorCriteriaIsMet>
                      <BasePageEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria>
                          <ContentMatchCriteria>
                            <RegExOperator>DoesNotContainSubstring</RegExOperator>
                            <Value>$Config/Phrase$</Value>
                          </ContentMatchCriteria>
                        </ErrorCriteria>
                      </BasePageEvaluationCriteria>
                      <LinksEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </LinksEvaluationCriteria>
                      <ResourcesEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </ResourcesEvaluationCriteria>
                      <WebPageTotalEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </WebPageTotalEvaluationCriteria>
                      <DepthEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </DepthEvaluationCriteria>
                    </RequestEvaluationCriteria>
                    <FormsAuthCredentials />
                  </Request>
                </Requests>
              </ProbeAction>
            </MemberModules>
            <Composition>
              <Node ID="Probe">
                <Node ID="Scheduler" />
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.WebApplicationData</OutputType>
      </DataSourceModuleType>
      <DataSourceModuleType ID="Custom.WebsiteWatcher.Library.ResponseTime" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="URLPath" type="xsd:string" />
          <xsd:element minOccurs="1" name="Interval" type="xsd:integer" />
          <xsd:element minOccurs="1" name="ResponseTime" type="xsd:decimal" />
        </Configuration>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
                <Scheduler>
                  <SimpleReccuringSchedule>
                    <Interval>$Config/Interval$</Interval>
                  </SimpleReccuringSchedule>
                  <ExcludeDates />
                </Scheduler>
              </DataSource>
              <ProbeAction ID="Probe" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.UrlProbe">
                <Proxy />
                <ProxyUserName />
                <ProxyPassword />
                <ProxyAuthenticationScheme>None</ProxyAuthenticationScheme>
                <CredentialUserName />
                <CredentialPassword />
                <AuthenticationScheme>None</AuthenticationScheme>
                <FollowRedirects>true</FollowRedirects>
                <RetryCount>0</RetryCount>
                <RequestTimeout>0</RequestTimeout>
                <Requests>
                  <Request>
                    <RequestID>1</RequestID>
                    <URL>$Config/URLPath$</URL>
                    <Verb>GET</Verb>
                    <Version>HTTP/1.1</Version>
                    <HttpHeaders>
                      <HttpHeader>
                        <Name>User-Agent</Name>
                        <Value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)</Value>
                      </HttpHeader>
                    </HttpHeaders>
                    <Body />
                    <CheckContentChange>false</CheckContentChange>
                    <ContentHash>00000000-0000-0000-0000-000000000000</ContentHash>
                    <Depth>0</Depth>
                    <ThinkTime>0</ThinkTime>
                    <CheckInternalLinks>false</CheckInternalLinks>
                    <CheckExternalLinks>false</CheckExternalLinks>
                    <CheckResources>false</CheckResources>
                    <RequestEvaluationCriteria>
                      <StopProcessingIfWarningCriteriaIsMet>false</StopProcessingIfWarningCriteriaIsMet>
                      <StopProcessingIfErrorCriteriaIsMet>false</StopProcessingIfErrorCriteriaIsMet>
                      <BasePageEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria>
                          <NumericCriteriaExpressions>
                            <NumericCriteriaExpression>
                              <NumericRequestMetric>BasePageData/TotalResponseTime</NumericRequestMetric>
                              <Operator>Greater</Operator>
                              <Value>$Config/ResponseTime$</Value>
                            </NumericCriteriaExpression>
                          </NumericCriteriaExpressions>
                        </ErrorCriteria>
                      </BasePageEvaluationCriteria>
                      <LinksEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </LinksEvaluationCriteria>
                      <ResourcesEvaluationCriteria>
                        <WarningCriteria>
                          <StatusCodeCriteria>
                            <ListNumericRequestMetric>StatusCode</ListNumericRequestMetric>
                            <Operator>GreaterEqual</Operator>
                            <Value>400</Value>
                          </StatusCodeCriteria>
                        </WarningCriteria>
                        <ErrorCriteria />
                      </ResourcesEvaluationCriteria>
                      <WebPageTotalEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </WebPageTotalEvaluationCriteria>
                      <DepthEvaluationCriteria>
                        <WarningCriteria />
                        <ErrorCriteria />
                      </DepthEvaluationCriteria>
                    </RequestEvaluationCriteria>
                    <FormsAuthCredentials />
                  </Request>
                </Requests>
              </ProbeAction>
            </MemberModules>
            <Composition>
              <Node ID="Probe">
                <Node ID="Scheduler" />
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.WebApplicationData</OutputType>
      </DataSourceModuleType>
      <DataSourceModuleType ID="Custom.WebsiteWatcher.Library.WatcherFinder" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="FQDN" type="xsd:string" />
          <xsd:element minOccurs="1" name="SourceID" type="xsd:string" />
          <xsd:element minOccurs="1" name="ManagedEntityID" type="xsd:string" />
          <xsd:element minOccurs="1" name="Class" type="xsd:string" />
          <xsd:element minOccurs="1" name="Property" type="xsd:string" />
          <xsd:element minOccurs="1" name="Interval" type="xsd:integer" />
          <xsd:element minOccurs="1" name="URLRegKey" type="xsd:string" />
        </Configuration>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
                <Scheduler>
                  <SimpleReccuringSchedule>
                    <Interval>$Config/Interval$</Interval>
                  </SimpleReccuringSchedule>
                  <ExcludeDates />
                </Scheduler>
              </DataSource>
              <ProbeAction ID="DiscoveryProbe" TypeID="Windows!Microsoft.Windows.ScriptDiscoveryProbe">
                <ScriptName>WatcherDiscovery.vbs</ScriptName>
                <Arguments>$Config/FQDN$ $Config/SourceID$ $Config/ManagedEntityID$ $Config/Class$ $Config/Property$ $Config/URLRegKey$</Arguments>
                <ScriptBody><![CDATA['Arg1 = FQDN of Watcher Node
'Arg2 = SourceID (MPElement)
'Arg3 = ManagedEntityID (Target/Id)
'Arg4 = Class ID
'Arg5 = Property ID
'Arg6 = URL Watcher reg key off hklm

Set oArgs = Wscript.Arguments
sFQDN = UCase(oArgs(0))
sSourceID = oArgs(1)
sManagedEntityID = oArgs(2)
sClassID = oArgs(3)
sPropertyID = oArgs(4)
sURLRegKey = oArgs(5)

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0,sSourceID, sManagedEntityID)

'Determine if this is a Watcher Node
const HKEY_LOCAL_MACHINE = &H80000002
bIsWatcher = False

Set oReg = GetObject("winmgmts:root\default:StdRegProv")
oReg.EnumValues HKEY_LOCAL_MACHINE, sURLRegKey, arrValues
If isarray(arrValues) Then
   bIsWatcher = True
End If

If bIsWatcher Then
   For Each sValue in arrValues
      oReg.GetStringValue HKEY_LOCAL_MACHINE, sURLRegKey, sValue, sURL
      Set oWatcher = oDiscoveryData.CreateClassInstance(sClassID)
      oWatcher.AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$",sFQDN
      oWatcher.AddProperty sPropertyID,sURL
      oWatcher.AddProperty "$MPElement[Name='System!System.Entity']/DisplayName$",sURL
      oDiscoveryData.AddInstance(oWatcher)
   Next
End If
Call oAPI.Return(oDiscoveryData)]]></ScriptBody>
                <TimeoutSeconds>240</TimeoutSeconds>
              </ProbeAction>
            </MemberModules>
            <Composition>
              <Node ID="DiscoveryProbe">
                <Node ID="Scheduler" />
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>System!System.Discovery.Data</OutputType>
      </DataSourceModuleType>
    </ModuleTypes>
    <MonitorTypes>
      <UnitMonitorType ID="Custom.WebsiteWatcher.Library.ErrorCodeFailure" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="ErrorCodeFailure" NoDetection="false" />
          <MonitorTypeState ID="ErrorCodeOK" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <xsd:element minOccurs="1" name="QueryIntervalInSeconds" type="xsd:integer" />
          <xsd:element minOccurs="1" name="URL" type="xsd:string" />
        </Configuration>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="DS1" TypeID="Custom.WebsiteWatcher.Library.URLProbe">
              <URLPath>$Config/URL$</URLPath>
              <Interval>$Config/QueryIntervalInSeconds$</Interval>
            </DataSource>
            <ProbeAction ID="OnDemandReset" TypeID="System!System.PassThroughProbe" />
            <ConditionDetection ID="CDErrorCodeFailureTrue" TypeID="System!System.ExpressionFilter">
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="UnsignedInteger">RequestResults/RequestResult[@Id=1]/BasePageData/ErrorCode</XPathQuery>
                  </ValueExpression>
                  <Operator>NotEqual</Operator>
                  <ValueExpression>
                    <Value Type="UnsignedInteger">0</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="CDErrorCodeFailureFalse" TypeID="System!System.ExpressionFilter">
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="UnsignedInteger">RequestResults/RequestResult[@Id=1]/BasePageData/ErrorCode</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="UnsignedInteger">0</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="ErrorCodeOK">
              <Node ID="CDErrorCodeFailureFalse">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="ErrorCodeFailure">
              <Node ID="CDErrorCodeFailureTrue">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
          </RegularDetections>
          <OnDemandDetections>
            <OnDemandDetection MonitorTypeStateID="ErrorCodeOK">
              <Node ID="OnDemandReset" />
            </OnDemandDetection>
          </OnDemandDetections>
        </MonitorImplementation>
      </UnitMonitorType>
      <UnitMonitorType ID="Custom.WebsiteWatcher.Library.PhraseMatchFailure" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="ContentMatchCriteriaOK" NoDetection="false" />
          <MonitorTypeState ID="ContentMatchCriteriaError" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <xsd:element minOccurs="1" name="QueryIntervalInSeconds" type="xsd:integer" />
          <xsd:element minOccurs="1" name="URL" type="xsd:string" />
          <xsd:element minOccurs="1" name="PhraseToLookFor" type="xsd:string" />
        </Configuration>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="DS1" TypeID="Custom.WebsiteWatcher.Library.ContentMatch">
              <URLPath>$Config/URL$</URLPath>
              <Interval>$Config/QueryIntervalInSeconds$</Interval>
              <Phrase>$Config/PhraseToLookFor$</Phrase>
            </DataSource>
            <ProbeAction ID="OnDemandReset" TypeID="System!System.PassThroughProbe" />
            <ConditionDetection ID="CDContentMatchCriteriaOK" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.OKCriteriaMatch">
              <DataItemEvaluationQuery>RequestResults/RequestResult[@Id=1]/BasePageData/ResponseBodyEvalResult</DataItemEvaluationQuery>
            </ConditionDetection>
            <ConditionDetection ID="CDContentMatchCriteriaError" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.ErrorCriteriaMatch">
              <DataItemEvaluationQuery>RequestResults/RequestResult[@Id=1]/BasePageData/ResponseBodyEvalResult</DataItemEvaluationQuery>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="ContentMatchCriteriaOK">
              <Node ID="CDContentMatchCriteriaOK">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="ContentMatchCriteriaError">
              <Node ID="CDContentMatchCriteriaError">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
          </RegularDetections>
          <OnDemandDetections>
            <OnDemandDetection MonitorTypeStateID="ContentMatchCriteriaOK">
              <Node ID="OnDemandReset" />
            </OnDemandDetection>
          </OnDemandDetections>
        </MonitorImplementation>
      </UnitMonitorType>
      <UnitMonitorType ID="Custom.WebsiteWatcher.Library.ResponseTimeFailure" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="ResponseTimeFailure" NoDetection="false" />
          <MonitorTypeState ID="ResponseTimeOK" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <xsd:element minOccurs="1" name="URL" type="xsd:string" />
          <xsd:element minOccurs="1" name="QueryTimeInSeconds" type="xsd:integer" />
          <xsd:element minOccurs="1" name="ResponseTimeInSeconds" type="xsd:decimal" />
        </Configuration>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="DS1" TypeID="Custom.WebsiteWatcher.Library.ResponseTime">
              <URLPath>$Config/URL$</URLPath>
              <Interval>$Config/QueryTimeInSeconds$</Interval>
              <ResponseTime>$Config/ResponseTimeInSeconds$</ResponseTime>
            </DataSource>
            <ProbeAction ID="OnDemandReset" TypeID="System!System.PassThroughProbe" />
            <ConditionDetection ID="CDResponseTimeFailure" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.ErrorCriteriaMatch">
              <DataItemEvaluationQuery>RequestResults/RequestResult[@Id=1]/BasePageData/TotalResponseTimeEvalResult</DataItemEvaluationQuery>
            </ConditionDetection>
            <ConditionDetection ID="CDResponseTimeOK" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.OKCriteriaMatch">
              <DataItemEvaluationQuery>RequestResults/RequestResult[@Id=1]/BasePageData/TotalResponseTimeEvalResult</DataItemEvaluationQuery>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="ResponseTimeFailure">
              <Node ID="CDResponseTimeFailure">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="ResponseTimeOK">
              <Node ID="CDResponseTimeOK">
                <Node ID="DS1" />
              </Node>
            </RegularDetection>
          </RegularDetections>
          <OnDemandDetections>
            <OnDemandDetection MonitorTypeStateID="ResponseTimeOK">
              <Node ID="OnDemandReset" />
            </OnDemandDetection>
          </OnDemandDetections>
        </MonitorImplementation>
      </UnitMonitorType>
    </MonitorTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="Custom.WebsiteWatcher.Library.SCCMMPDiscovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="true" Remotable="true" Priority="Normal">
        <Category>Custom</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="Custom.WebsiteWatcher.Library.SCCMMP">
            <Property TypeID="Custom.WebsiteWatcher.Library.SCCMMP" PropertyID="URL" />
            <Property TypeID="System!System.Entity" PropertyID="DisplayName" />
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DSDiscovery" TypeID="Custom.WebsiteWatcher.Library.WatcherFinder">
          <FQDN>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</FQDN>
          <SourceID>$MPElement$</SourceID>
          <ManagedEntityID>$Target/Id$</ManagedEntityID>
          <Class>$MPElement[Name='Custom.WebsiteWatcher.Library.SCCMMP']$</Class>
          <Property>$MPElement[Name='Custom.WebsiteWatcher.Library.SCCMMP']/URL$</Property>
          <Interval>86400</Interval>
          <URLRegKey>Software\URLWatcher\SCCMMP</URLRegKey>
        </DataSource>
      </Discovery>
      <Discovery ID="Custom.WebsiteWatcher.Library.POSDiscovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="true" Remotable="true" Priority="Normal">
        <Category>Custom</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="Custom.WebsiteWatcher.Library.POS">
            <Property TypeID="Custom.WebsiteWatcher.Library.POS" PropertyID="URL" />
            <Property TypeID="System!System.Entity" PropertyID="DisplayName" />
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DSDiscovery" TypeID="Custom.WebsiteWatcher.Library.WatcherFinder">
          <FQDN>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</FQDN>
          <SourceID>$MPElement$</SourceID>
          <ManagedEntityID>$Target/Id$</ManagedEntityID>
          <Class>$MPElement[Name='Custom.WebsiteWatcher.Library.POS']$</Class>
          <Property>$MPElement[Name='Custom.WebsiteWatcher.Library.POS']/URL$</Property>
          <Interval>86400</Interval>
          <URLRegKey>Software\URLWatcher\POS</URLRegKey>
        </DataSource>
      </Discovery>
      <Discovery ID="Custom.WebsiteWatcher.Library.StoreInvDiscovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="true" Remotable="true" Priority="Normal">
        <Category>Custom</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="Custom.WebsiteWatcher.Library.StoreInv">
            <Property TypeID="Custom.WebsiteWatcher.Library.StoreInv" PropertyID="URL" />
            <Property TypeID="System!System.Entity" PropertyID="DisplayName" />
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DSDiscovery" TypeID="Custom.WebsiteWatcher.Library.WatcherFinder">
          <FQDN>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</FQDN>
          <SourceID>$MPElement$</SourceID>
          <ManagedEntityID>$Target/Id$</ManagedEntityID>
          <Class>$MPElement[Name='Custom.WebsiteWatcher.Library.StoreInv']$</Class>
          <Property>$MPElement[Name='Custom.WebsiteWatcher.Library.StoreInv']/URL$</Property>
          <Interval>86400</Interval>
          <URLRegKey>Software\URLWatcher\StoreInv</URLRegKey>
        </DataSource>
      </Discovery>
    </Discoveries>
    <Monitors>
      <UnitMonitor ID="Custom.WebsiteWatcher.Library.SCCMMPMonitor" Accessibility="Internal" Enabled="true" Target="Custom.WebsiteWatcher.Library.SCCMMP" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Custom.WebsiteWatcher.Library.ErrorCodeFailure" ConfirmDelivery="true">
        <Category>Custom</Category>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateIddc679e2e38c241d0b19e839206adfe02" MonitorTypeStateID="ErrorCodeFailure" HealthState="Error" />
          <OperationalState ID="UIGeneratedOpStateIdeabddbf09aa24778b5ae4d20d4ac8281" MonitorTypeStateID="ErrorCodeOK" HealthState="Success" />
        </OperationalStates>
        <Configuration>
          <QueryIntervalInSeconds>15</QueryIntervalInSeconds>
          <URL>$Target/Property[Type="Custom.WebsiteWatcher.Library.SCCMMP"]/URL$</URL>
        </Configuration>
      </UnitMonitor>
      <UnitMonitor ID="Custom.WebsiteWatcher.Library.POSMonitor" Accessibility="Public" Enabled="true" Target="Custom.WebsiteWatcher.Library.POS" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Custom.WebsiteWatcher.Library.ResponseTimeFailure" ConfirmDelivery="true">
        <Category>Custom</Category>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateId3368fc81e1ff420288e889d104c860b4" MonitorTypeStateID="ResponseTimeFailure" HealthState="Error" />
          <OperationalState ID="UIGeneratedOpStateIdefb973d0718a422ebc47b4b94a72604f" MonitorTypeStateID="ResponseTimeOK" HealthState="Success" />
        </OperationalStates>
        <Configuration>
          <URL>$Target/Property[Type="Custom.WebsiteWatcher.Library.POS"]/URL$</URL>
          <QueryTimeInSeconds>15</QueryTimeInSeconds>
          <ResponseTimeInSeconds>0.005</ResponseTimeInSeconds>
        </Configuration>
      </UnitMonitor>
      <UnitMonitor ID="Custom.WebsiteWatcher.Library.StoreInvMonitor" Accessibility="Public" Enabled="true" Target="Custom.WebsiteWatcher.Library.StoreInv" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Custom.WebsiteWatcher.Library.PhraseMatchFailure" ConfirmDelivery="true">
        <Category>Custom</Category>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateId46ebc537cdf84a47a0577efbb032d4ae" MonitorTypeStateID="ContentMatchCriteriaOK" HealthState="Success" />
          <OperationalState ID="UIGeneratedOpStateIdf17651c0f1ce498d9d03373aa028c3fe" MonitorTypeStateID="ContentMatchCriteriaError" HealthState="Error" />
        </OperationalStates>
        <Configuration>
          <QueryIntervalInSeconds>15</QueryIntervalInSeconds>
          <URL>$Target/Property[Type="Custom.WebsiteWatcher.Library.StoreInv"]/URL$</URL>
          <PhraseToLookFor>store inventory web application</PhraseToLookFor>
        </Configuration>
      </UnitMonitor>
    </Monitors>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library">
          <Name>Website Watcher Library</Name>
          <Description>This MP is used to monitor websites</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.ErrorCodeFailure">
          <Name>Error Code Failure</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.URLProbe">
          <Name>URL Probe</Name>
          <Description>This data source checks to see whether the page is up or down.</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.ContentMatch">
          <Name>Content Match</Name>
          <Description>This data source checks a URL for a string.</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.ResponseTime">
          <Name>Response Time</Name>
          <Description>This data source measures the response time of a web page.</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.PhraseMatchFailure">
          <Name>Phrase Match Failure</Name>
          <Description>This monitor type is used to evaluate whether a string exists on a web site.</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.ResponseTimeFailure">
          <Name>Response Time Failure</Name>
          <Description>This monitor type is used to detect slow websites.</Description>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.WatcherFinder">
          <Name>Watcher Finder</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMP">
          <Name>SCCM MP Class</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMPPerspective">
          <Name>SCCM MP Perspective</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMPDiscovery">
          <Name>SCCM MP Discovery</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMPMonitor">
          <Name>SCCM Management Point Monitor</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMPMonitor" SubElementID="UIGeneratedOpStateIddc679e2e38c241d0b19e839206adfe02">
          <Name>ErrorCodeFailure</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.SCCMMPMonitor" SubElementID="UIGeneratedOpStateIdeabddbf09aa24778b5ae4d20d4ac8281">
          <Name>ErrorCodeOK</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.POS">
          <Name>Point of Sale Website Class</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.POSPerspective">
          <Name>Point of Sales Website Perspective</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.StoreInv">
          <Name>Store Inventory Website Class</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.StoreInvPerspective">
          <Name>Store Inventory Website Perspective</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.POSMonitor">
          <Name>Point of Sale Website Monitor</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.POSMonitor" SubElementID="UIGeneratedOpStateId3368fc81e1ff420288e889d104c860b4">
          <Name>ResponseTimeFailure</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.POSMonitor" SubElementID="UIGeneratedOpStateIdefb973d0718a422ebc47b4b94a72604f">
          <Name>ResponseTimeOK</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.StoreInvMonitor">
          <Name>Store Inventory Monitor</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.StoreInvMonitor" SubElementID="UIGeneratedOpStateId46ebc537cdf84a47a0577efbb032d4ae">
          <Name>ContentMatchCriteriaOK</Name>
        </DisplayString>
        <DisplayString ElementID="Custom.WebsiteWatcher.Library.StoreInvMonitor" SubElementID="UIGeneratedOpStateIdf17651c0f1ce498d9d03373aa028c3fe">
          <Name>ContentMatchCriteriaError</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>