Checks

At its core, Argos runs checks and return the results to the service. Here are the implemented checks, with a description of what they do and how to configure them.

Simple checks

These checks are the most basic ones. They simply check that the response from the service matches what you expect.

Check

Description

Configuration

status-is

Check that the returned status code matches what you expect.

status-is: "200"

status-in

Check that the returned status code is in the list of codes you expect.

status-in:
- 200
- 302

body-contains

Check that the returned body contains a given string.

body-contains: "Hello world"

body-like

Check that the returned body matches a given regex.

body-like: "Hel+o w.*"

headers-contain

Check that the response contains the expected headers.

headers-contain:
- "content-encoding"
- "content-type"

headers-have

Check that the response contains the expected headers with the expected value.

headers-have:
content-encoding: "gzip"
content-type: "text/html"

headers-like

Check that response headers contains the expected headers and that the values matches the provided regexes.

headers-like:
content-encoding: "gzip|utf"
content-type: "text/(html|css)"

json-contains

Check that JSON response contains the expected structure.

json-contains:
- /foo/bar/0
- /timestamp

json-has

Check that JSON response contains the expected structure and values.

json-has:
/maintenance: false
/productname: "Nextcloud"

json-like

Check that JSON response contains the expected structure and that the values matches the provided regexes.

json-like:
/productname: ".*cloud"
/versionstring: "29\\..*"

json-is

Check that JSON response is the exact expected JSON object.

json-is: '{"foo": "bar", "baz": 42}'

http-to-https

Check that the HTTP version of the domain redirects to HTTPS. Multiple choices of configuration.

http-to-https: true
http-to-https: 301
http-to-https:
start: 301
stop: 308
http-to-https:
- 301
- 302
- 307

argos-config.yaml
- domain: "https://example.org"
  paths:
    - path: "/"
      checks:
        - status-is: 200
        - body-contains: "Hello world"
        - body-like: "Hel+o w.*"
        - headers-contain:
            - "content-encoding"
            - "content-type"
        # Check that there is a HTTP to HTTPS redirection with 3xx status code
        - http-to-https: true
        # Check that there is a HTTP to HTTPS redirection with 301 status code
        - http-to-https: 301
        # Check that there is a HTTP to HTTPS redirection with a status code
        # in the provided range (stop value excluded)
        - http-to-https:
            start: 301
            stop: 308
        # Check that there is a HTTP to HTTPS redirection with a status code
        # in the provided list
        - http-to-https:
            - 301
            - 302
            - 307
    - path: "/foobar"
      checks:
        - status-in:
            - 200
            - 302
        # It’s VERY important to respect the 4 spaces indentation here!
        - headers-have:
            content-encoding: "gzip"
            content-type: "text/html"
        # It’s VERY important to respect the 4 spaces indentation here!
        # You have to double the escape character \
        - headers-like:
            content-encoding: "gzip|utf"
            content-type: "text/(html|css)"
        - json-contains:
            - /foo/bar/0
            - /timestamp
        # It’s VERY important to respect the 4 spaces indentation here!
        - json-has:
            /maintenance: false
            /productname: "Nextcloud"
        # It’s VERY important to respect the 4 spaces indentation here!
        # You have to double the escape character \
        - json-like:
            /productname: ".*cloud"
            /versionstring: "29\\..*"
        - json-is: '{"foo": "bar", "baz": 42}'

SSL certificate expiration

Checks that the SSL certificate will not expire soon. You need to define the thresholds in the configuration, and set the on-check option to enable the check.

argos-config.yaml
ssl:
  thresholds:
    - "1d": critical
    - "5d": warning

- domain: "https://example.org"
  paths:
    - path: "/"
      checks:
        - ssl-certificate-expiration: "on-check"