Monitoring XML DocumentsSiteScope's content matching capabilities is an important feature in monitoring networked information systems and content. For SiteScope monitors that provide content matching, the basic content matching is available through the use of PERL regular expressions. SiteScope also includes the capability of matching document content by traversing XML documents. For example, you can include an XML match content string using the URL Monitor and Web Services Monitor to match an XML element name, an attribute of an XML element, or the content of an element. You can use this to check for content in XML based Web pages, SOAP or XML-RPC documents, and even WML pages served to WAP enabled devices. This section describes:
Understanding Content Matching for XML DocumentsThe syntax of XML match content strings reflects the hierarchal structure of the XML document. Match content strings that start with "xml." are recognized as element names within an XML document. The element names are added, separated by periods, in the order of their relationship to the root element. For example, in the document weather.xml the root element is <weather>. This element includes child elements named <area>, <skies>, <wind>, <forecast>, and so forth. To access the content of these XML elements or their attributes you would use a syntax like xml.weather.area. To check that specific content or value is present, add an equals sign after the element name whose content you are testing and then add the value of the content. If there are multiple instances of an element name in the document you can check a particular instance of that element by adding the number indicating the order of the element in the document in square brackets (see the example in the table below). You can also test for multiple elements or values by separating individual search strings with commas. The table below gives several examples of the syntax used to match content in XML documents
Using XML Content Match Values in Monitor ConfigurationsMonitors like the URL Monitor have a content match value that is logged to the SiteScope monitor data log and can also be used to set error and warning status thresholds for the monitor. The values of the XML names are saved as the content match values for the monitor. For example, if the match content expression was You can then set the error, warning, and good status thresholds in the Advanced Options section for the monitor to compare your specific thresholds to the value returned by the content match. For example, if you were monitoring temperature values and wanted to be alerted when the temperature value dropped below 72 degrees you could set the monitor status thresholds as follows: With this configuration the monitor would check the content of the temperature element and then compare it to the error and warning thresholds. In the example we have used here, the status of the monitor would be an error because the temperature value is 46 which is less than 72.
|