XML Sensor
Overview
The XML Sensor in Onagre allows users to monitor and validate XML responses from an HTTP endpoint. It ensures that specific elements or attributes contain expected values, helping teams verify the correctness of API responses and detect unexpected changes in structured data.
Configuration Options
When setting up an XML Sensor, the following parameters can be configured:
- URL: The target endpoint returning XML data.
- HTTP Method: The request method to use (GET, POST, etc.).
- Request Payload (optional): Data to send with POST or PUT requests.
- Headers (optional): Custom headers to include in the request.
- Timeout: Maximum time to wait for a response before considering the request as failed.
- Expected HTTP Status Codes: Define acceptable response codes (e.g., 200 OK).
- Authentication (optional): Supports Basic Authentication and Bearer Token authentication.
- XPath Expression: The XPath query to extract the value for validation.
- Expected Value: The expected content of the selected XML element or attribute.
- Comparison Operator: Defines how the expected value should be compared (e.g., equals, greater than, contains).
- Check Interval: Defines how often the request should be sent (e.g., every minute, every five minutes).
Response Validation
The XML Sensor validates responses based on:
- Exact Value Matching: Checks if the extracted element or attribute matches an expected value.
- Numerical Comparisons: Allows greater than, less than, and range comparisons.
- String Matching: Supports substring search and case sensitivity options.
- Boolean Validation: Ensures that a field is
trueorfalse.
Alerts and Notifications
If the XML response does not match the expected conditions, the sensor can trigger alerts via:
- Slack, Microsoft Teams, Discord, Google Chat, Webhooks, Pushover
- Email Notifications
- Onagre’s Dashboard for Incident Tracking
Use Cases
- Ensuring an API returns the correct value within an XML response.
- Verifying numerical thresholds, such as server load or active user count.
- Checking boolean flags, such as system health indicators.
- Monitoring changes in structured XML data.
Deployment
The XML Sensor can be used with both public and private resources. For internal monitoring, Onagre’s private agent can be deployed to check endpoints that are not accessible from the internet.
Summary
The XML Sensor is an essential tool for monitoring structured API responses, allowing precise validation of key values and detecting anomalies in real time. With flexible configuration and integration with modern communication tools, it helps teams maintain data integrity and service reliability.