Management commands

This section will talk about all available management commands that Argus offers.

Initial setup

To create the standard instances and fill any lookup tables one can use the command initial_setup:

$ python manage.py initial_setup

See the inbuilt help for flags and toggles:

$ python manage.py initial_setup --help

To set the email address of the created admin user, which by default is not set, add the -e flag to the command as such:

$ python manage.py initial_setup -e "admin@example.com"

To set the user name of the created admin user, which by default is admin, add the -u flag to the command as such:

$ python manage.py initial_setup -u "Name"

To set the password of the created admin user add the -p flag to the command as such:

$ python manage.py initial_setup -p "secure-password"

Generate a secret key

To generate a secret key to be used in the cmd.sh file one can use the command gen_secret_key:

$ python manage.py gen_secret_key

Warning

Keep the SECRET_KEY secret, as it is relevant to the security and integrity of your Argus instance.

Create fake incidents

To fill the database with fake incidents for testing purposes one can use the 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

By default create_fake_incident creates an open stateful incident.

To create multiple incidents one can use the -b flag and determine the number of incidents:

$ python manage.py create_fake_incident -b 15

To add a custom description add the -d flag to the command as such:

$ python manage.py create_fake_incident -d "Custom description"

To set the level of the incident add the -l flag to the command as such and choose a level between 1 and 5 (1 being the highest severity, 5 the lowest):

$ python manage.py create_fake_incident -l 2

To add more tags to the incident add the -t flag to the command and tags of the form key=value (add multiple separated by a space):

$ python manage.py create_fake_incident -t a=b c=d

And if the incident should be stateless add the flag –stateless:

$ python manage.py create_fake_incident --stateless

(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.)

Create source

To create a new source system in the database for testing purposes one can use the command create_source:

$ python manage.py create_source

See the inbuilt help for flags and toggles:

$ python manage.py create_source --help

This command takes the name for the new source as an argument, if none is given, the name will be argus:

$ python manage.py create_source "Source name"

To add a custom source system type, instead of the default argus, add the -t flag to the command as such:

$ python manage.py create_source -t "Custom type"

Check for token expiry

One can check if any of the tokens that are connected to a source system will expire soon with the management command check_token_expiry:

$ python manage.py check_token_expiry

See the inbuilt help for flags and toggles:

$ python manage.py check_token_expiry --help

By default check_token_expiry checks if any token will expire within in the next 7 days. To change that default one can use the -d-flag and give a different number of days:

$ python manage.py check_token_expiry -d 14

In case any of the existing tokens, which are connected to a source system, will expire within the next given number of days, Argus will post an incident to let the user know.

Also if an expiry incident is found for which the referenced token is not close to expiring anymore this incident will be closed. This can happen when the variable AUTH_TOKEN_EXPIRES_AFTER_DAYS in Site-specific settings is changed.

This incident will automatically be closed if the token related to the incident is renewed, deleted or replaced by a new one.