Installation

Requirements

  • Python 3.11+

  • PostgreSQL 13+ (for production)

Install with pip

pip install argos-monitoring

You may want to install Argos in a virtualenv:

python3 -m venv venv
source venv/bin/activate
pip install argos-monitoring

Install from sources

Once you got the source locally, create a virtualenv and install the dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -e .

Configure

The quickest way to get started is to get the config-example.yaml file from our repository and edit it:

wget https://framagit.org/framasoft/framaspace/argos/-/raw/main/conf/config-example.yaml -O config.yaml

You can read more about the configuration in the configuration section.

Configure the server

Environment variables are used to configure the server. You can also put them in an .env file:

.env
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

Please note that the only supported database engines are SQLite for development and PostgreSQL for production.

Apply migrations to database

Create the schema in the database with:

argos server migrate

Inject tasks into the database

Argos keeps tasks’ configuration in database, take from the config file.

Populate the database with the tasks:

argos server reload-config

Starting the server

Then you can start the server:

argos server start

The server reads the yaml file at startup, and populates the tasks queue with the checks defined in the configuration.

Generating a token

The agent needs an authentication token to be able to communicate with the server.

You can generate an authentication token with the following command:

argos server generate-token

Add the token in the configuration file, in the following setting:

service:
  secrets:
    - "auth-token"

Running the agent

You can run the agent on the same machine as the server, or on a different machine. The only requirement is that the agent can reach the server.

argos agent http://localhost:8000 "auth-token"

Cleaning the database

You also have to run cleaning tasks periodically. argos server clean --help will give you more information on how to do that.

Here is a crontab example, which will clean the db each hour:

# Run the cleaning tasks every hour (at minute 7)
# Keeps 10 results per task, and remove tasks’ locks older than 1 hour
7 * * * * argos server cleandb --max-results 10 --max-lock-seconds 3600