Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After the installation of PostgreSQL, the database and tables required by WiFiMon should be created.  Detailed instructions are included in the following subsections.

Anchor
database
database

...

2.1. Database and User Creation

Run the following commands to create the database wifimon_database and user wifimon_user. This database The following code block includes the appropriate SQL commands required to create (i) a database that will store information related to Subnets , and Access Points and user accounts monitored by WiFiMon as well as accounts of users that can access the GUI. From root user become user postgres with “ WiFiMon GUI and (ii) a user that will be able to access this database. The following commands create the (i) database "wifimon_database" and (ii) the user "wifimon_user" with password "wifimonpass". We strongly suggest that these example names are changed in production environments.

Accessing PostgreSQL requires becoming user "postgres". This is possible from the "root" user using the command “su postgres”. Afterwards, use the following commands and appropriately set the password for the wifimon_user:       psqlthe terminal-based front-end of PostgreSQL is accessed using the command "psql". 

Code Block
languagesql
CREATE USER wifimon_user WITH PASSWORD 'wifimonpass';
CREATE DATABASE wifimon_database OWNER wifimon_user;

Once After the creation of the database "wifimon_database" is created, connecting to it , selecting this database is possible using via the following command:

Code Block
languagesql
\c wifimon_database;


Execute The following subsections include the commands in the following paragraphs to create the necessary tables.

...

that are necessary for the creation of the required tables.

2.2. Creation of "subnets" Table

In order to measure the WiFi performance, WiFiMon embeds JavaScript in frequently-visited websites and the tests are triggered once the End User visits these websites. However, the tests should be restricted only to users/subnets that are served by the WiFi network that is measured. To achieve this, a list of the registered Subnets that are allowed to perform tests is included in subnets table:

Code Block
languagesql
CREATE TABLE subnets (
subnet text,
subnet_id serial PRIMARY KEY );

...

2.3. Creation of "users" Table

WiFiMon GUI can be accessed by two types of WiFiMon Users: ADMIN and USER. ADMIN has full access to the WiFiMon GUI and can for example add/remove registered Subnets and Access Points, and add/remove Users. USER has limited rights and may only navigate through the measurements results and timeseries dashboards. Table users is used to store the WiFiMon Users information in the database.

Code Block
languagesql
CREATE TABLE users (
id serial PRIMARY KEY,
email text NOT NULL,
password_hash text NOT NULL,
role text NOT NULL);

...

2.4. Creation of "accesspoints" Table

Table accesspoints is used to store the Access Point information (latitude, longitude, building, floor, notes) in the database. This information is later used to depict the measurements per Access Point.

Code Block
languagesql
CREATE TABLE accesspoints (
apid serial PRIMARY KEY,
mac text NOT NULL,
latitude text,
longitude text,
building text,
floor text,
notes text);

...

2.5. Creation of "options" Table

Options table stores important privacy settings such as hiding or showing End User related data in the WiFiMon GUI. Correlation options are also included in this table.

...