argos/docs/checks.md
Luc Didry fde061da19
— Add new check type: status-in
Similar to status-is except that the HTTP status can be one of a list, instead of just one fixed value.

Usecase: a Sympa server with CAS authentication set. Without a sympa_session cookie, you get a 302 status,
with it, you have a 200 status.
2024-07-04 14:32:46 +02:00

51 lines
1.4 KiB
Markdown

# 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. | <pre><code>status-in:<br> - 200<br> - 302</code></pre> |
| `body-contains` | Check that the returned body contains a given string. | `body-contains: "Hello world"` |
```{code-block} yaml
---
caption: argos-config.yaml
---
- domain: "https://example.org"
paths:
- path: "/"
checks:
- status-is: 200
- body-contains: "Hello world"
- path: "/foobar"
checks:
- status-in:
- 200
- 302
```
## 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.
```{code-block} yaml
---
caption: argos-config.yaml
---
ssl:
thresholds:
- "1d": critical
- "5d": warning
- domain: "https://example.org"
paths:
- path: "/"
checks:
- ssl-certificate-expiration: "on-check"
```