Table Of Contents

Previous topic

Installing Reef

Next topic


Running and Configuring Reef

Refer to Runtime Settings Refer to ashttpd.conf Refer to ashttpd

Configuring the Database


Reef needs a database to store all it’s events in. It ships with an SQLite database which is suitable for small deployments and proof of concepts. However SQLite can not handle parallel connections so when scaling up the first step is to use an external database.

Using the builtin SQLite database

Reefs ships with a default SQLite database which can be used for demos or small deployments. By default it has one superuser configured with the username of “admin” and password “admin”. This allows you to use the admin interface to change the credentials and add other users. It is highly recommended to change at least the password of the admin user.

If you need would like to create a new superuser using the command line you need to invoke the following command:

$ PYTHONPATH=/opt/ createsuperuser –settings=reef.django_settings –username foo

This will prompt you for a password to use.

Using an external database

Abilisoft recommends to use PostgreSQL as external database as it provides many features and scalability options as well as being extendable in many scripting languages. There a number of steps involved in setting up an external database:

  1. Configure the connection details.
  2. Create the schema and indexes.
  3. Create an initial superuser.

The descriptions below assume that reef itself is hosted using ashttpd in it’s default configuration. When hosting reef on other WSGI servers some details may be different.

Obviously you need to have configured the database itself before you commence these steps. Setting up the database is not described here.

Configuring Connection Details

The reef server needs connection details for the database, normally it reads those from $AS_HOME/etc/ashttpd.conf in the [django.db:default] section, e.g.:

ENGINE = django.db.backends.postgresql_psycopg2
NAME = reef
USER = reef
PASSWORD = secret
HOST = psqlserver

The above example configures a PostgreSQL database running on the host psqlserver that is listening on the default PostgreSQL port (5432). If an alternate port is required then you can set the PORT value accordingly. The ENGINE value specifies the database backend that Reef will use to connect to PostgreSQL. The NAME settings specifies the database name, in this case, reef.

Creating the schema and indexes

The schema and indexes are created using syncdb subcommand of the tool shipped with reef. There are a few things to look out for when using this: you must ensure the reef python library is loaded and you must point the tool at the reef configuration this is done.

$ PYTHONPATH=/opt/ \ syncdb --settings=reef.django_settings

This will ask you to create an initial superuser, it is best to create one right away in which case you can skip the last step of creating one explicitly.

Creating a Superuser

If you didn’t create a superuser as part of the previous step you will need to do this now. You need to create an initial superuser from the command line. After this it is possible to create new users using the admin interface of reef. This is done using the createsuperuser subcommand of the tool. As before you need to point it to the reef python library and it’s Django configuration.

$ PYTHONPATH=/opt/ createsuperuser –settings=reef.django_settings –username foo

Example setting up PostgreSQL

This example demonstrates how to set up the PostgreSQL database on CentOS 5.6. It starts by installing the database server itself:

# yum install postgresql84-server
# service postgresql initdb
# service postgresql start

Now the database server is installed and running. It is installed under the postgres user and only this user is known to the database for now. So next we need to create a user, ensure the user has a password so the reef server can connect to it:

# su - postgres
$ createuser --pwprompt myuser
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
$ logout

Once the user exists we need to give that user a database, we’ll create a database named reef:

# createdb -O myuser reef

Next we’ll configure the connection in reef:

# cat >/opt/ <<EOF
ENGINE = django.db.backends.postgresql_psycopg2
NAME = reef
USER = myuser
PASSWORD = secret

Notice how we do not include the HOST and PORT directives, since we connect to the localhost we do not need these and will actually break the default PostgreSQL authentication on a localhost.

It is now time to initialise the database for reef use. This will also prompt to create a superuser in the reef database. This is a user account which you will be able to log into the reef admin interface to manage other users:

# PYTHONPATH=/opt/ \
> syncdb --settings=reef.django_settings
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table app_eventsvc_servicedef_filterdefs
Creating table app_eventsvc_servicedef
Creating table app_eventsvc_filterdef
Creating table app_eventsvc_filterterm
Creating table app_reef_event
Creating table app_reef_eventattr
Creating table app_reef_eventlog
Creating table app_reef_severity

You just installed Django's auth system, which means you
don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'flub'): admin
E-mail address:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 41 object(s) from 2 fixture(s)

Now you can start asdjango as normal:

# asdjango
asdjango application initialising (2.6.5a0 (calculon.5a0) r10360  20110818)

And you will be able to navigate to the reef client on the default URL of http://localhost:8000/client or just go to the landing page at http://localhost:8000/.

Using a Reverse Proxy

Reef Site Administration

The Reef Admin console home page is divided into sections, one for each internal application.

Click Add to add a new object of a particular type.

Click the Object name link or the Change link to view a list of and edit an object of a particulr type.

Recent Actions shows a lit of recent updates. The links will navigate you to the affected object.

App Eventsvc

Service defs

See below for description of each Service definition attribute. Each Service definition also has a related set of one or more Filter definitions.

Genral Fields
  • Name
  • Label
  • Descrption
Show summary checkbox
Assigning Filter Definitions

Use drop down list to assign an existing Filter definition to the Service definition. Clicking the Add icon will open a pop-up enabling you to create a new Filter definition.

Filter defs

See below for description of each Filter definition attribute. Each Filter definition also has a related set of one or more Filter terms.

General Fields
  • Name
  • Label
  • Descrption
And terms checkbox
Sort order field

Filter Terms

Attr name field
Op field

Refer to filter def operators in references.

Cmp val0 field
Cmp val1 field
Exclude checkbox

App Reef

Event logs



User fields