-
-
Notifications
You must be signed in to change notification settings - Fork 59
Database Layout
(For version 0.900-0)
Database Layout - AlertR Server
- Internals
- Options
- Nodes
- Sensors
- SensorsAlertLevels
- SensorsDataInt
- SensorsDataFloat
- SensorsDataGPS
- Alerts
- AlertsAlertLevels
- Managers
Database Layout - AlertR Manger Client Database
- Internals
- Options
- Profiles
- Nodes
- Sensors
- SensorsAlertLevels
- SensorsDataInt
- SensorsDataFloat
- SensorsDataGPS
- SensorAlerts
- SensorAlertsAlertLevels
- SensorAlertsDataInt
- SensorAlertsDataFloat
- SensorAlertsDataGPS
- Alerts
- AlertsAlertLevels
- Managers
- AlertLevels
In the following the database layout of the AlertR server is described.
Used for internal settings/options/values that should not be changed from the outside.
table: internals
- type (primary key)
- value
Used for options of the AlertR system.
table options
- type (primary key)
- value
Used for each client that connects to the server.
table nodes
- id (primary key)
- hostname (hostname of the client)
- username (username used by the client; is also the unique identifier of the client)
- nodeType (sensor, alert, manager)
- instance (i.e., alertClientDbus or sensorClientFIFO)
- connected (0 = no, 1 = yes)
- version
- rev
- persistent (0 = no, 1 = yes)
Used for each sensor watched by a client.
table sensors
- id (primary key)
- nodeId (id to the entry in the nodes table)
- clientSensorId (id used by the client for this sensor)
- description
- state (0 = normal, 1 = triggered)
- alertDelay
- dataType (gives the type of data the sensor holds and consequentially where to find it: 0 = none, 1 = int, 2 = float)
- error_state
- error_msg
Used for the registered alert levels (you can think of an alert level as a group) for sensors.
table sensorsAlertLevels
- sensorId (id to the entry in the sensors table, primary key)
- alertLevel (primary key)
Used to store the integer data of the corresponding sensor.
table sensorsDataInt
- sensorId (id to the entry in the sensors table, primary key)
- value
- unit
Used to store the floating point data of the corresponding sensor.
table sensorsDataFloat
- sensorId (id to the entry in the sensors table, primary key)
- value
- unit
Used to store the GPS data of the corresponding sensor.
table sensorsDataGPS
- sensorId (id to the entry in the sensors table, primary key)
- lat
- lon
- utctime
Used for each alert that is managed by a client. It has to be notified by the server when a sensor alert has triggered.
table alerts
- id (primary key)
- nodeId (id to the entry in the nodes table)
- clientAlertId (id used by the client for this alert)
- description
Used for the registered alert levels (you can think of an alert level as a group) for registered alerts.
table alertsAlertLevels
- alertId (id to the entry in the alerts table, primary key)
- alertLevel (primary key)
Used for all registered manager clients.
table managers
- id (primary key)
- nodeId (id to the entry in the nodes table)
- description
In the following the database layout of the AlertR Manger Client Database is described.
Used for internal settings/options/values that should not be changed from the outside.
table: internals
- id (primary key)
- type
- value
Used for options of the AlertR system.
table options
- id (primary key)
- type
- value
Used for profiles of the AlertR system.
table profiles
- id (primary key)
- name
Used for each client that connects to the server.
table nodes
- id (primary key)
- hostname (hostname of the client)
- nodeType (sensor, alert, manager)
- instance (i.e., alertClientDbus or sensorClientFIFO)
- connected (0 = no, 1 = yes)
- version
- rev
- newestVersion (the newest version that is available in the configured repository)
- newestRev (the newest revision that is available in the configured repository)
- username (username used by the client; is also the unique identifier of the client)
- persistent (0 = no, 1 = yes)
Used for each sensor watched by a client.
table sensors
- id (primary key)
- nodeId (id to the entry in the nodes table)
- clientSensorId (id used by the client for this sensor)
- description
- state (0 = normal, 1 = triggered)
- alertDelay
- dataType (gives the type of data the sensor holds and consequentially where to find it: 0 = none, 1 = int, 2 = float)
- error_state
- error_msg
Used for the registered alert levels (you can think of an alert level as a group) for sensors.
table sensorsAlertLevels
- sensorId (id to the entry in the sensors table, primary key)
- alertLevel (primary key)
Used to store the integer data of the corresponding sensor.
table sensorsDataInt
- sensorId (id to the entry in the sensors table, unique, primary key)
- value
- unit
Used to store the floating point data of the corresponding sensor.
table sensorsDataFloat
- sensorId (id to the entry in the sensors table, unique, primary key)
- value
- unit
Used to store the GPS data of the corresponding sensor.
table sensorsDataGPS
- sensorId (id to the entry in the sensors table, unique, primary key)
- lat
- lon
- utctime
Used for a triggered sensor alert (will be stored for the time given in the configuration file).
table sensorAlerts
- id (primary key)
- sensorId (id to the entry in the sensors table)
- state (0 = normal, 1 = triggered)
- description
- timeReceived (unix timestamp)
- changeState (0 = False, 1 = True)
- hasLatestData (0 = False, 1 = True)
- dataJson (json string that represents the optional data that was sent by the sensor during an alert)
- dataType (gives the type of data the sensor alert holds and consequentially where to find it: 0 = none, 1 = int, 2 = float)
Used for the alert levels that are triggered by the sensor alert.
table sensorAlertsAlertLevels
- sensorAlertId (id to the entry in the sensorAlerts table, primary key)
- alertLevel (primary key)
Used to store the integer data of the corresponding sensor.
table sensorAlertsDataInt
- sensorAlertId (id to the entry in the sensorAlerts table, unique, primary key)
- value
- unit
Used to store the floating point data of the corresponding sensor.
table sensorAlertsDataFloat
- sensorAlertId (id to the entry in the sensorAlerts table, unique, primary key)
- value
- unit
Used to store the GPS data of the corresponding sensor.
table sensorAlertsDataGPS
- sensorAlertId (id to the entry in the sensorAlerts table, unique, primary key)
- lat
- lon
- lat
Used for each alert that is managed by a client.
table alerts
- id (primary key)
- nodeId (id to the entry in the nodes table)
- clientAlertId (id used by the client for this alert)
- description
Used for the registered alert levels (you can think of an alert level as a group) for registered alerts.
table alertsAlertLevels
- alertId (id to the entry in the alerts table, primary key)
- alertLevel (primary key)
Used for all registered manager clients.
table managers
- id (primary key)
- nodeId (id to the entry in the nodes table)
- description
Used for all registered manager clients.
table alertLevels
- alertLevel (primary key)
- name
- instrumentation_active (0 = no, 1 = yes)
- instrumentation_cmd
- instrumentation_timeout
Used for the registered profiles for an alert level.
table alertLevelsProfiles
- alertLevel (alertLevel to the entry in the alertLevels table, primary key)
- profileId (id to the entry in the profiles table, primary key)