The http module performs GET requests over either HTTP or HTTPS and checks the return code and optionally the body.
lua
noit.module.http
required
.+
The URL including schema and hostname (as you would type into a browser's location bar).
optional
.+
Allows the setting of arbitrary HTTP headers in the request.
optional
GET
\S+
The HTTP method to use.
optional
.*
The information transferred as the payload of an HTTP request.
optional
^(?:Basic|Digest|Auto)$
HTTP Authentication method to use.
optional
[^:]*
The user to authenticate as.
optional
.*
The password to use during authentication.
optional
.+
A path to a file containing all the certificate authorities that should be loaded to validate the remote certificate (for SSL checks).
optional
.+
A path to a file containing the client certificate that will be presented to the remote server (for SSL checks).
optional
.+
A path to a file containing key to be used in conjunction with the cilent certificate (for SSL checks).
optional
.+
A list of ciphers to be used in the SSL protocol (for SSL checks).
optional
^200$
.+
The HTTP code that is expected. If the code received does not match this regular expression, the check is marked as "bad."
optional
0
\d+
The maximum number of Location header redirects to follow.
optional
.+
This regular expression is matched against the body of the response. If a match is not found, the check will be marked as "bad."
optional
.+
This regular expression is matched against the body of the response. If a match is found it is captured and added as a metric. For example, if setting is named 'body_match_foo_bar' and a match is found new metric called 'foo_bar' will be added.
optional
.+
This regular expression is matched against the body of the response globally. The first capturing match is the key and the second capturing match is the value. Each key/value extracted is registered as a metric for the check.
optional
10000
\d+
This sets the PCRE internal match limit (see pcreapi documentation).
optional
false
^(?:true|false|on|off)$
Include whole response body as a metric with the key 'body'.
optional
0
\d+
Sets an approximate limit on the data read (0 means no limit).
Example 5.14. Checking an HTTP and HTTPS URL.
This example checks the OmniTI Labs website over both HTTP and HTTPS.
<noit>
<modules>
<loader image="lua" name="lua">
<config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config>
</loader>
<module loader="lua" name="http" object="noit.module.http" />
</modules>
<checks>
<labs target="8.8.38.5" module="http">
<check uuid="fe3e984c-7895-11dd-90c1-c74c31b431f0" name="http">
<config><url>http://labs.omniti.com/</url></config>
</check>
<check uuid="1ecd887a-7896-11dd-b28d-0b4216877f83" name="https">
<config><url>https://labs.omniti.com/</url></config>
</check>
</labs>
</checks>
</noit>