Configuration¶
There are actually two configuration files: one for the service and one for the checks.
Server configuration¶
The server configuration is done using environment variables. You can put them in a .env
file at the root of the project.
Here is a list of the useful variables, in the .env
format:
ARGOS_YAML_FILE = "my-config.yaml"
ARGOS_DATABASE_URL = "postgresql://argos:argos@localhost/argos"
DB_POOL_SIZE = 10 # https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.pool_size
DB_MAX_OVERFLOW = 20
Environment variables¶
Here are the environment variables you can define to configure how the service will behave :
ARGOS_YAML_FILE¶
The path to the yaml configuration file, defining the checks.
ARGOS_DATABASE_URL¶
The database url, as defined in SQLAlchemy docs.
For instance, to connect to a postgres database on localhost with user, pass and dbname “argos”:
ARGOS_DATABASE_URL = "postgresql://argos:argos@localhost/argos"
DB_POOL_SIZE¶
DB_MAX_OVERFLOW¶
You configure the size of the database pool of connection, and the max overflow (until when new connections are accepted ?) These are documented in the SQLAlchemy docs in greater details
DB_POOL_SIZE = 10
DB_MAX_OVERFLOW = 20
Argos “checks” configuration¶
Argos uses a YAML configuration file to define the websites to monitor and the checks to run on these websites.
Here is a simple configuration file:
general:
frequency: "1m" # Run checks every minute.
# Which way do you want to be warned when a check goes to that severity?
alerts:
ok:
- local
warning:
- local
critical:
- local
unknown:
- local
# mail:
# mailfrom: no-reply@example.org
# host: 127.0.0.1
# port: 25
# ssl: False
# starttls: False
# auth:
# login: foo
# password: bar
# addresses:
# - foo@admin.example.org
# - bar@admin.example.org
# gotify:
# - url: https://example.org
# tokens:
# - foo
# - bar
service:
secrets:
# Secrets can be generated using `openssl rand -base64 32`.
ssl:
thresholds:
- "1d": critical
- "5d": warning
# It's also possible to define the checks in another file
# with the include syntax:
#
# websites: !include websites.yaml
#
websites:
- domain: "https://mypads.example.org"
paths:
- path: "/mypads/"
checks:
- status-is: 200
- body-contains: '<div id= "mypads"></div>'
- ssl-certificate-expiration: "on-check"
- path: "/admin/"
checks:
- status-is: 401
- domain: "https://munin.example.org"
paths:
- path: "/"
checks:
- status-is: 301
- path: "/munin/"
checks:
- status-is: 401