Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
When configuring a multi-instance DataSource, you have the option of enabling Active Discovery and subsequently defining the protocol (e.g. SNMP, WMI, HTTP, etc.) employed by Active Discovery to find instances.
In this support article, we’ll overview the HTTP Active Discovery method, its various parameters, and the two modes it supports:
Note: HTTP Active Discovery does not support authentication. If your HTTP endpoint requires authentication, you must script Active Discovery.
The HTTP method of Active Discovery parameters include the following configurations.
GET /server-status HTTP/1.0
In extracting mode, the user needs to specify a URL and a regular expression that returns a substring via a capture group, but leave the port list empty.
The HTTP Active Discovery method will send a HTTP request to the target server to get the specified URI, and applies the regex against the response (including headers and payload) to extract instances that match the substring. Each returned substring that matches the backreference will be a discovered instance.
Imagine that a web page “/customer-list” that contains the ID of all customers, and returns output similar to the following:
customer id: 1234
customer id: 2345
customer id: 3456
A datasource needs those customer IDs as its instances. In this case, the HTTP Active Discovery method would specify parameters as below:
Active Discovery will send an HTTP request “/customer-list” to the host, and apply the regex “customer id: (\d+)” to the response. This regex will capture three IDs (1234, 2345, 3456) in the page and return them as instances to be monitored.
When working in port mode, the user specifies a port list, a URI, and a regex (note: the regex in port mode doesn’t need to capture a substring). Active Discovery will send an HTTP request to each port in the port list, and apply the regex to the response (including headers and payload). The port will be returned as an instance if a substring in the HTTP response from that port matches the regex.
For example, if a company runs Apache on different ports on different servers, possibly with multiple Apache processes on the same server, port mode can be used to detect this.
An Apache server supports a status page (/server-status) that will report statistics about the server usage. The Apache datasource Active Discovery can be defined as follows:
Active Discovery will send “/server-status” to each port in the range 80 through 83, and check if the response has a substring matching the regular expression “>Apache Status<“. If so, it will return that port as one of instances.
In This Article