Skip to main content

Argus is an alert aggregator for monitoring systems

Project description

Argus

build badge codecov badge Code style: black docs badge

Argus is a platform for aggregating incidents across network management systems, and sending notifications to users. Users create notification profiles that define which incidents they subscribe to.

This repository hosts the backend built with Django. There is also a REACT SPA frontend.

See also the the Python client library.

Installation

There are several ways to install Argus.

Prerequisites

Requirements

  • Python 3.7+
  • pip

Optional requirements

  • Redis is recommended if you are going to run the frontend. Redis backs the websockets, in order to push realtime updates to the frontend.
  • Argus-frontend
  • PostgreSQL
  • Docker and docker-compose to run Argus in Docker

Optional: Dataporten registration

Dataporten authentication is supported by Argus and can be used to log into Argus-frontend. Refer to the Dataporten section of the documentation to learn about Dataporten registration, and how to set it up with Argus.

Install Argus using pip

You can also install Argus with pip via PyPI. The package name is argus-server:

$ pip install argus-server

If you are using the PyPI package in production, please note: The file requirements.txt contains the versions of dependencies that the release was tested on. To update all the dependencies to recent versions, use pip-compile:

$ pip install pip-tools
$ pip-compile -o your-updated-requirements.txt
$ pip install --upgrade -r your-updated-requirements.txt

Now change and adapt Argus' settings according to your needs.

Run the initial Argus setup, and make note of the admin password that is generated:

$ python manage.py initial_setup
******************************************************************************

  Created Argus superuser "admin" with password "2S0qJbjVEew0GunL".

   Please change the password via the admin interface.

******************************************************************************

Then run the Argus API server:

$ python manage.py runserver

Setup Argus using Docker Compose

Download the source code first.

$ git clone https://github.com/Uninett/Argus.git
$ cd Argus

Running Argus with docker-compose is as simple as

$ docker-compose up

Run the initial Argus setup, and make note of the admin password that is generated:

$ docker-compose exec api django-admin initial_setup
******************************************************************************

  Created Argus superuser "admin" with password "ns6bfoKquW12koIP".

   Please change the password via the admin interface.

******************************************************************************

You will find Argus running at http://localhost:8000/.

Settings in Argus

Site-specific settings can either be set using environment variables, using a settings.py file, or a combination of both.

For more information on both methods and a list of the settings, consult the documentation section on site-specific settings.

Running Argus in development

Step 1: Installation

You can use docker-compose to conveniently setup a complete dev environment for Argus, including PostgreSQL. Instructions are provided above.

To do a manual install instead, follow these steps.

Download the source code first.

$ git clone https://github.com/Uninett/Argus.git
$ cd Argus

We recommend using virtualenv or virtaulenvwrapper to create a place to stash Argus' dependencies.

Create and activate a Python virtual environment.

$ python -m venv venv
$ source venv/bin/activate

Install Argus' requirements into the virtual env.

$ pip install -r requirements-django32.txt
$ pip install -r requirements/dev.txt

Step 2: Setting environment variables and Django settings

Copy the cmd.sh-template to cmd.sh and make it executable

$ cp cmd.sh-template cmd.sh
$ chmod u+x cmd.sh

Now set the environment variables in the file using an editor.

Required settings in cmd.sh are

  • DATABASE_URL,
  • DJANGO_SETTINGS_MODULE and
  • SECRET_KEY.

The DATAPORTEN variables are optional. Refer to the dataporten section of setting site-specific settings for details.

DJANGO_SETTINGS_MODULE can be set to argus.site.settings.dev.

If you need more complex settings than environment variables and cmd.sh can provide, we recommend having a localsettings.py in the same directory as manage.py with any overrides.

Refer to the development notes for further details and useful hints on managing Argus in development mode.

Step 3: Run Argus in development

Afterwards, run the initial Argus setup and start the server.

$ python manage.py initial_setup
$ python manage.py runserver

You will find Argus running at http://localhost:8000/.

Code style

Argus uses black as a source code formatter. Black will automatically install with the dev requirements.

A pre-commit hook will format new code automatically before committing. To enable this pre-commit hook, run

$ pre-commit install

Running tests

Given that Argus is installed and configured as described above, this command is the most basic option to run the tests.

$ python manage.py test

If you have installed tox, the following command will test Argus code against several Django versions, several Python versions, and automatically compute code coverage.

$ tox

An HTML coverage report will be generated. Refer to the tox.ini file for further options.

Mock data

Fill the database with mock data with the management command create_fake_incident:

$ python manage.py create_fake_incident

See the inbuilt help for flags and toggles:

$ python manage.py create_fake_incident --help

Since the current default number of shown incidents in the frontend is 10, you might want to create just more than 10 incidents in one go, with the -b-flag:

$ python manage.py create_fake_incident -b 15

(The same command is well-suited to manually test the notification system: Make a filter that matches fake incidents, for instance by setting source to argus, and create a single fake incident by omitting the -b-flag.)

Project details


Release history Release notifications | RSS feed

This version

1.5.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

argus_server-1.5.0-py3-none-any.whl (103.4 kB view details)

Uploaded Python 3

File details

Details for the file argus_server-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: argus_server-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 103.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/3.7.3 keyring/23.0.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for argus_server-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1e3b3640440feadb4443d769d8a5a918ab05a1eab6f6f52688269377d2bce1
MD5 5b66c9e6d107ab89cf13f3e7238cc7f7
BLAKE2b-256 f15d47f8fd077b22d2237217bc0512f0f0dc2d7c5918163bea7ef4814d32ce1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page