argus-server


Nameargus-server JSON
Version 1.15.0 PyPI version JSON
download
home_pageNone
SummaryArgus is an alert aggregator for monitoring systems
upload_time2024-04-10 06:37:59
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Argus
[![build badge](https://github.com/Uninett/Argus/workflows/build/badge.svg)](https://github.com/Uninett/Argus/actions)
[![codecov badge](https://codecov.io/gh/Uninett/Argus/branch/master/graph/badge.svg)](https://codecov.io/gh/Uninett/Argus)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![docs badge](https://readthedocs.org/projects/argus-server/badge/?version=latest&style=flat)](http://argus-server.rtfd.io/en/latest/)

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. See [Argus docs](http://argus-server.rtfd.io/en/latest/) for more details.

This repository hosts the backend built with Django. There is also a
[REACT SPA frontend](https://github.com/Uninett/Argus-frontend).


See also the the [Python client library](https://github.com/Uninett/pyargus).

## Installation

There are several ways to install Argus.

### Prerequisites

#### Requirements

* Python 3.8+
* Django 4.2 or 5.0
* 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](https://github.com/Uninett/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](http://argus-server.rtfd.io/en/latest/dataporten.html) 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`:
```console
$ pip install argus-server
```

If you are using the PyPI package in production, please note: The file
`requirements.txt` contains the pinned versions of dependencies that the
release was tested on. The file `constraints.txt` is for controlling versions
of sub-dependencies so as to not poison the pyproject.toml.

To update the dependency lock-files, use `tox`:

```console
$ pip install tox
$ tox -e upgrade-deps -- -U
```

To upgrade a single dependency, replace the `-U` flag with `-P PACKAGENAME`.

To install from the lock-file use pip:

```console
$ pip install -c constraints.txt --upgrade -r requirements.txt
```

Now change and adapt [Argus' settings](#settings-in-argus) according to your needs.

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

```console
$ 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:

```console
$ python manage.py runserver
```

### Setup Argus using Docker Compose

Download the source code first.
```console
$ git clone https://github.com/Uninett/Argus.git
$ cd Argus
```

Running Argus with docker-compose is as simple as
```console
$ docker-compose up
```

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

```console
$ 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](http://argus-server.rtfd.io/en/latest/site-specific-settings.html).


## 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](#setup-argus-using-docker-compose).

To do a manual install instead, follow these steps.

Download the source code first.
```console
$ 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.
```console
$ python -m venv venv
$ source venv/bin/activate
```

Install Argus' requirements into the virtual env.
```console
$ 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
```console
$ 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](http://argus-server.rtfd.io/en/latest/site-specific-settings.html) 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](http://argus-server.rtfd.io/en/latest/development.html) 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.
```console
$ 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](requirements/dev.txt).

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

```console
$ 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.
```console
$ 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.
```console
$ tox
```
An [HTML coverage report](htmlcov/index.html) will be generated.
Refer to the [tox.ini](tox.ini) file for further options.

## Using towncrier to automatically produce the changelog
### Before opening a PR
To be able to automatically produce the changelog for a release a file for each
pull request (also called news fragment) needs to be added to the folder
`changelog.d/`.
The name of the file consists of three parts seperated by a period:
1. The identifier, either the issue number this pull request is refering to or if
there is no related issue a `+` followed by a unique short description.
2. The type of the change, we use `critical`, `added`, `changed` and `fixed`.
3. The file suffix, e.g. `.md`, towncrier does not care which suffix a fragment has.

So an example for a file name linked to an issue would be `214.added.md` or for a file
without corresponding issue `+fixed-pagination-bug.fixed.md`.

This file can either be created manually with a file name as specified above and the
changelog text as content or one can use towncrier to create such a file as following:

```console
$ towncrier create -c "Changelog content" 214.added.md
```

When opening a PR there will be a check to make sure that a news fragment is added, it
will fail if it is missing.

### Before a release
To add all content from the `changelog.d/` folder to the changelog file simply run
```console
$ towncrier build --version {version}
```
This will also delete all files in `changelog.d/`.

To preview what the addition to the changelog file would look like add the flag `--draft`.

A few other helpful flags:
- `date DATE` - set the date of the release, default is today
- `keep` - keep all news fragments

More information about [towncrier](https://towncrier.readthedocs.io).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "argus-server",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Uninett Opensource <opensource@uninett.no>",
    "download_url": "https://files.pythonhosted.org/packages/f0/bd/0633e0e2e4d39c8d15249e3c1eb0d86efacbb3ae2d45713faec957bea018/argus-server-1.15.0.tar.gz",
    "platform": "any",
    "description": "# Argus\n[![build badge](https://github.com/Uninett/Argus/workflows/build/badge.svg)](https://github.com/Uninett/Argus/actions)\n[![codecov badge](https://codecov.io/gh/Uninett/Argus/branch/master/graph/badge.svg)](https://codecov.io/gh/Uninett/Argus)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![docs badge](https://readthedocs.org/projects/argus-server/badge/?version=latest&style=flat)](http://argus-server.rtfd.io/en/latest/)\n\nArgus is a platform for aggregating incidents across network management systems, and\nsending notifications to users. Users create notification profiles that define which\nincidents they subscribe to. See [Argus docs](http://argus-server.rtfd.io/en/latest/) for more details.\n\nThis repository hosts the backend built with Django. There is also a\n[REACT SPA frontend](https://github.com/Uninett/Argus-frontend).\n\n\nSee also the the [Python client library](https://github.com/Uninett/pyargus).\n\n## Installation\n\nThere are several ways to install Argus.\n\n### Prerequisites\n\n#### Requirements\n\n* Python 3.8+\n* Django 4.2 or 5.0\n* pip\n\n#### Optional requirements\n\n* **Redis**\n  is recommended if you are going to run the frontend.\n  Redis backs the websockets, in order to push realtime updates to the frontend.\n* [Argus-frontend](https://github.com/Uninett/Argus-frontend/)\n* PostgreSQL\n* Docker and docker-compose to run Argus in Docker\n\n#### Optional: Dataporten registration\n\nDataporten authentication is supported by Argus and can be used to log into\nArgus-frontend.\nRefer to the [Dataporten](http://argus-server.rtfd.io/en/latest/dataporten.html) section of the documentation to learn\nabout Dataporten registration, and how to set it up with Argus.\n\n### Install Argus using pip\n\nYou can also install Argus with `pip` via PyPI. The package name is `argus-server`:\n```console\n$ pip install argus-server\n```\n\nIf you are using the PyPI package in production, please note: The file\n`requirements.txt` contains the pinned versions of dependencies that the\nrelease was tested on. The file `constraints.txt` is for controlling versions\nof sub-dependencies so as to not poison the pyproject.toml.\n\nTo update the dependency lock-files, use `tox`:\n\n```console\n$ pip install tox\n$ tox -e upgrade-deps -- -U\n```\n\nTo upgrade a single dependency, replace the `-U` flag with `-P PACKAGENAME`.\n\nTo install from the lock-file use pip:\n\n```console\n$ pip install -c constraints.txt --upgrade -r requirements.txt\n```\n\nNow change and adapt [Argus' settings](#settings-in-argus) according to your needs.\n\nRun the initial Argus setup, and make note of the admin password that is generated:\n\n```console\n$ python manage.py initial_setup\n******************************************************************************\n\n  Created Argus superuser \"admin\" with password \"2S0qJbjVEew0GunL\".\n\n   Please change the password via the admin interface.\n\n******************************************************************************\n```\n\nThen run the Argus API server:\n\n```console\n$ python manage.py runserver\n```\n\n### Setup Argus using Docker Compose\n\nDownload the source code first.\n```console\n$ git clone https://github.com/Uninett/Argus.git\n$ cd Argus\n```\n\nRunning Argus with docker-compose is as simple as\n```console\n$ docker-compose up\n```\n\nRun the initial Argus setup, and make note of the admin password that is generated:\n\n```console\n$ docker-compose exec api django-admin initial_setup\n******************************************************************************\n\n  Created Argus superuser \"admin\" with password \"ns6bfoKquW12koIP\".\n\n   Please change the password via the admin interface.\n\n******************************************************************************\n```\n\n\nYou will find Argus running at http://localhost:8000/.\n\n## Settings in Argus\n\nSite-specific settings can either be set using environment variables, using a\n`settings.py` file, or a combination of both.\n\nFor more information on both methods and a list of the settings, consult the\ndocumentation section on\n[site-specific settings](http://argus-server.rtfd.io/en/latest/site-specific-settings.html).\n\n\n## Running Argus in development\n\n### Step 1: Installation\n\nYou can use docker-compose to conveniently setup a complete dev environment for Argus,\nincluding PostgreSQL. Instructions\n[are provided above](#setup-argus-using-docker-compose).\n\nTo do a manual install instead, follow these steps.\n\nDownload the source code first.\n```console\n$ git clone https://github.com/Uninett/Argus.git\n$ cd Argus\n```\n\nWe recommend using virtualenv or virtaulenvwrapper to create\na place to stash Argus' dependencies.\n\nCreate and activate a Python virtual environment.\n```console\n$ python -m venv venv\n$ source venv/bin/activate\n```\n\nInstall Argus' requirements into the virtual env.\n```console\n$ pip install -r requirements-django32.txt\n$ pip install -r requirements/dev.txt\n```\n\n### Step 2: Setting environment variables and Django settings\n\nCopy the `cmd.sh-template` to `cmd.sh` and make it executable\n```console\n$ cp cmd.sh-template cmd.sh\n$ chmod u+x cmd.sh\n```\nNow set the environment variables in the file using an editor.\n\nRequired settings in `cmd.sh` are\n\n- `DATABASE_URL`,\n- `DJANGO_SETTINGS_MODULE` and\n- `SECRET_KEY`.\n\nThe `DATAPORTEN` variables are optional. Refer to the dataporten section of\n[setting site-specific settings](http://argus-server.rtfd.io/en/latest/site-specific-settings.html) for details.\n\n`DJANGO_SETTINGS_MODULE` can be set to `argus.site.settings.dev`.\n\nIf you need more complex settings than environment variables and ``cmd.sh`` can provide,\nwe recommend having a `localsettings.py` in the same directory as `manage.py` with any\noverrides.\n\nRefer to the [development notes](http://argus-server.rtfd.io/en/latest/development.html) for further details and\nuseful hints on managing Argus in development mode.\n\n### Step 3: Run Argus in development\n\nAfterwards, run the initial Argus setup and start the server.\n```console\n$ python manage.py initial_setup\n$ python manage.py runserver\n```\n\nYou will find Argus running at http://localhost:8000/.\n\n### Code style\n\nArgus uses black as a source code formatter. Black will automatically install\nwith the [dev requirements](requirements/dev.txt).\n\nA pre-commit hook will format new code automatically before committing.\nTo enable this pre-commit hook, run\n\n```console\n$ pre-commit install\n```\n\n\n## Running tests\n\nGiven that Argus is installed and configured as described above,\nthis command is the most basic option to run the tests.\n```console\n$ python manage.py test\n```\n\nIf you have installed `tox`, the following command will\ntest Argus code against several Django versions, several Python versions, and\nautomatically compute code coverage.\n```console\n$ tox\n```\nAn [HTML coverage report](htmlcov/index.html) will be generated.\nRefer to the [tox.ini](tox.ini) file for further options.\n\n## Using towncrier to automatically produce the changelog\n### Before opening a PR\nTo be able to automatically produce the changelog for a release a file for each\npull request (also called news fragment) needs to be added to the folder\n`changelog.d/`.\nThe name of the file consists of three parts seperated by a period:\n1. The identifier, either the issue number this pull request is refering to or if\nthere is no related issue a `+` followed by a unique short description.\n2. The type of the change, we use `critical`, `added`, `changed` and `fixed`.\n3. The file suffix, e.g. `.md`, towncrier does not care which suffix a fragment has.\n\nSo an example for a file name linked to an issue would be `214.added.md` or for a file\nwithout corresponding issue `+fixed-pagination-bug.fixed.md`.\n\nThis file can either be created manually with a file name as specified above and the\nchangelog text as content or one can use towncrier to create such a file as following:\n\n```console\n$ towncrier create -c \"Changelog content\" 214.added.md\n```\n\nWhen opening a PR there will be a check to make sure that a news fragment is added, it\nwill fail if it is missing.\n\n### Before a release\nTo add all content from the `changelog.d/` folder to the changelog file simply run\n```console\n$ towncrier build --version {version}\n```\nThis will also delete all files in `changelog.d/`.\n\nTo preview what the addition to the changelog file would look like add the flag `--draft`.\n\nA few other helpful flags:\n- `date DATE` - set the date of the release, default is today\n- `keep` - keep all news fragments\n\nMore information about [towncrier](https://towncrier.readthedocs.io).\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Argus is an alert aggregator for monitoring systems",
    "version": "1.15.0",
    "project_urls": {
        "Homepage": "https://github.com/Uninett/Argus"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "577216d7a08abf268217e863855f149528f7517092f8d91745224cbbf75c90d8",
                "md5": "d39a007bba01c8fde9df9ed1bd3d46f3",
                "sha256": "de137a2841b6c2c43f382a20d3b9728a0b0e666c9de507944bacbca1037ed366"
            },
            "downloads": -1,
            "filename": "argus_server-1.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d39a007bba01c8fde9df9ed1bd3d46f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 128368,
            "upload_time": "2024-04-10T06:37:56",
            "upload_time_iso_8601": "2024-04-10T06:37:56.184227Z",
            "url": "https://files.pythonhosted.org/packages/57/72/16d7a08abf268217e863855f149528f7517092f8d91745224cbbf75c90d8/argus_server-1.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0bd0633e0e2e4d39c8d15249e3c1eb0d86efacbb3ae2d45713faec957bea018",
                "md5": "8c7eca1c1f78bdfbe7c51da2e9ef4cbd",
                "sha256": "db4b97f1759e29ac4c6e76b8555df43501c61fbc869b0fac43c50f5596a873b3"
            },
            "downloads": -1,
            "filename": "argus-server-1.15.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8c7eca1c1f78bdfbe7c51da2e9ef4cbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 431763,
            "upload_time": "2024-04-10T06:37:59",
            "upload_time_iso_8601": "2024-04-10T06:37:59.549074Z",
            "url": "https://files.pythonhosted.org/packages/f0/bd/0633e0e2e4d39c8d15249e3c1eb0d86efacbb3ae2d45713faec957bea018/argus-server-1.15.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 06:37:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Uninett",
    "github_project": "Argus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "argus-server"
}
        
Elapsed time: 0.41872s