Monitoring URL

Hansi 116 Reputation points


I am creating a Management Pack and a part of it is requesting an URL with Microsoft.SystemCenter.WebApplication.UrlProbe.

One requirement is to set header objects using configuration file. Therefore, in the discovery, I assemble the string according to the HttpHeadersType and store that in the class under the headers setting.
Example: <HttpHeader><name>Accept</Name><Value>/</Value></HttpHeader><HttpHeader><name>Accept-Language</Name><Value>en-us</Value></HttpHeader><HttpHeader><name>Accept-Encoding</Name><Value>GZIP</Value></HttpHeader>.

My Class:

<ClassType ID="MY.TEST.Class"
          <Property ID="ID" Type="string" Key="true" />
          <Property ID="Name" Type="string" Key="false" />
          <Property ID="URL" Type="string" Key="false" />
          <Property ID="Description" Type="string" Key="false" />
          <Property ID="HTTPHeaders" Type="string" Key="false" />

Now I want to pass this string to the sample:

     <xsd:element minOccurs="0" name="Headers" type="xsd:string"/>

But I will get an error on build:
Schema validation failed.
The element 'HttpHeaders' must not contain any text. Expected list of possible elements: 'HttpHeaders'.

Is it possible to implement the requirement this way, or do I have to store the individual header elements as separate properties in the class. I would like to avoid this.


Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,424 questions
0 comments No comments
{count} votes

Accepted answer
  1. CyrAz 5,181 Reputation points

    As you can see in , the structure of the <HttpHeaders> block must indeed be in the Name/Value format, you can't pass a string.

    And URLGenie MP which also relies on native urlprobe does indeed have 3 "HeaderName" and 3 "HeaderValue" properties defined in the Http Request Seed class :

    If you want to avoid this, you'll have to avoid using the native urlprobe. A powershell monitor would be a more flexible solution, using Invoke-WebRequest for example.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful