5.21. monit

The Monit module parses XML data from the Monit service and returns the values as metrics.

loader

lua

object

noit.module.monit

5.21.1. Module Configuration

5.21.2. Check Configuration

url
required

required

allowed

.+

The URL including schema and hostname (as you would type into a browser's location bar).

port
required

optional

allowed

\d+

The port on which the Monit server is running.

read_limit
required

optional

default

0

allowed

\d+

Sets an approximate limit on the data read (0 means no limit).

header_(\S+)
required

optional

allowed

.+

Allows the setting of arbitrary HTTP headers in the request.

auth_user
required

optional

allowed

.+

The Monit user

auth_password
required

optional

allowed

.+

The Monit password

ca_chain
required

optional

allowed

.+

A path to a file containing all the certificate authorities that should be loaded to validate the remote certificate (for SSL checks).

certificate_file
required

optional

allowed

.+

A path to a file containing the client certificate that will be presented to the remote server (for SSL checks).

key_file
required

optional

allowed

.+

A path to a file containing key to be used in conjunction with the cilent certificate (for SSL checks).

ciphers
required

optional

allowed

.+

A list of ciphers to be used in the SSL protocol (for SSL checks).

Example 5.22. Checking Monit services on localhost

This example checks the Monit service on localhost.

      <noit>
        <modules>
          <loader image="lua" name="lua">
            <config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config>
          </loader>
          <module loader="lua" name="monit" object="noit.module.monit"/>
        </modules>
        <checks>
          <check target="127.0.0.1" module="monit" name="monit" uuid="a524f3fb-f60c-434f-98a4-060ab42e1b7d" period="10000" timeout="5000">
            <config>
              <url>http://127.0.0.1:2812/_status?format=xml</url>
              <port>2812</port>
              <auth_user>admin</auth_user>
              <auth_password>monit</auth_password>
            </config>
          </check>
        </checks>
      </noit>