2.1. System configuration¶
Contents
2.1.1. Database configuration (PostgreSQL)¶
2.1.1.1. Create database¶
Create a role sanet and a database sanet3 with encoding ‘utf8’:
CREATE ROLE sanet LOGIN PASSWORD 'sanet'; CREATE DATABASE sanet3 OWNER sanet ENCODING 'utf8'; GRANT ALL ON DATABASE sanet3 to sanet;
2.1.1.1.1. Debian 9¶
Lauch Postgres’s shell as postgres user:
# su postgres # psql -U postgres
Enter:
CREATE ROLE sanet LOGIN PASSWORD 'sanet'; CREATE DATABASE sanet3 OWNER sanet ENCODING 'utf8'; GRANT ALL ON DATABASE sanet3 to sanet;
2.1.2. Configure Redis Server¶
Redis Server does not require any change to default settings.
2.1.3. Configure RRD Tools¶
RRD Tools not require special configurations.
2.1.4. Optional configurations¶
2.1.4.1. BIN tools¶
Be sure to include the “bin” directory in your PATH:
export PATH=$PATH:{{SANET_INSTALL_DIR}}/bin
2.1.5. Configure Sanet’s server¶
2.1.5.1. Create config file¶
Create a new configuration file:
cd {{SANET_INSTALL_DIR}} ./install/post_install_create_settings.sh conf/settings.py
Or manually edit:
cd conf cp settings.py.dist settings.py
You MUST set database connection settings propertly in conf/settings.py :
from conf.default_settings import * # Django settings for netsentry_webui project. DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE' : DEFAULT_DATABASE_BACKEND, 'HOST' : 'localhost', 'PORT' : '5432', 'NAME' : 'sanet3', 'USER' : 'sanet', 'PASSWORD': 'sanet', } }
2.1.5.2. Init Sanet Server database and files¶
Initialize Sanet’s internal database configuration:
sanet-manage sanetdata
Or:
cd {{SANET_INSTALL_DIR}} python manage.py sanetdata