Chapter 5. Modules

5.1. check_test

This module exposes an API endpoint to allow users to run a check once in transient mode to return the results inline back to the client.

The check runs once however it behaves almost exactly like a /check/set

loader

C

image

check_test.so

5.1.1. Module Configuration

5.1.2. Check Configuration

Example 5.1. Loading the check_test module.

This example loads the check_test module.

      <noit>
        <modules>
          <generic image="check_test" name="check_test" />
        </modules>
      </noit>
    

5.1.3. REST Endpoint

5.1.3.1. /checks/test

method
POST
uri
/checks/test

This call accepts a document describing a check. In the same request, the check will execute and return the results back to the user. The check passes through the same validation as the /check/set PUT REST call. The check is marked as transient and won't appear in any persistent log streams.

On success, a HTTP 200 is returned and an XML documented that matches the format of the /check/show REST command. It is a simpler set of output as some of the results wouldn't make sense in this context.

Example 5.2. REST /checks/test XML input.

<?xml version="1.0" encoding="utf8"?>
<check>
  <attributes>
    <name>http</name>
    <module>http</module>
    <target>8.8.38.5</target>
    <period>60000</period>
    <timeout>5000</timeout>
    <filterset>default</filterset>
  </attributes>
  <config>
    <code>200</code>
    <url>https://labs.omniti.com/</url>
  </config>
</check>