|
1 | | - |
| 1 | + |
2 | 2 | # A high-level description of the database structure |
3 | 3 |
|
4 | | - An overview of the most important database tables as well as an detailed overview of the Devices table. The MAC address is used as a foreign key in most cases. |
| 4 | + An overview of the most important database tables as well as an detailed overview of the Devices table. The MAC address is used as a foreign key in most cases. |
5 | 5 |
|
6 | 6 | ## Devices database table |
7 | 7 |
|
|
23 | 23 | | `devLogEvents` | Whether events related to the device should be logged. | `0` | |
24 | 24 | | `devAlertEvents` | Whether alerts should be generated for events. | `1` | |
25 | 25 | | `devAlertDown` | Whether an alert should be sent when the device goes down. | `0` | |
| 26 | +| `devCanSleep` | Whether the device can enter a sleep window. When `1`, offline periods within the `NTFPRCS_sleep_time` window are shown as **Sleeping** instead of **Down** and no down alert is fired. | `0` | |
26 | 27 | | `devSkipRepeated` | Whether to skip repeated alerts for this device. | `1` | |
27 | 28 | | `devLastNotification` | Timestamp of the last notification sent for this device. | `2025-03-22 12:07:26+11:00` | |
28 | 29 | | `devPresentLastScan` | Whether the device was present during the last scan. | `1` | |
|
42 | 43 | | `devParentRelType` | The type of relationship between the current device and it's parent node. By default, selecting `nic` will hide it from lists. | `nic` | |
43 | 44 | | `devReqNicsOnline` | If all NICs are required to be online to mark teh current device online. | `0` | |
44 | 45 |
|
| 46 | +> [!NOTE] |
| 47 | +> `DevicesView` extends the `Devices` table with two computed fields that are never persisted: |
| 48 | +> - `devIsSleeping` (`1` when `devCanSleep=1`, device is offline, and `devLastConnection` is within the `NTFPRCS_sleep_time` window). |
| 49 | +> - `devFlapping` (`1` when the device has changed state more than the flap threshold times in the trailing window). |
| 50 | +> - `devStatus` — derived string: `On-line`, `Sleeping`, `Down`, or `Off-line`. |
| 51 | +
|
45 | 52 |
|
46 | | -To understand how values of these fields influuence application behavior, such as Notifications or Network topology, see also: |
| 53 | +To understand how values of these fields influuence application behavior, such as Notifications or Network topology, see also: |
47 | 54 |
|
48 | 55 | - [Device Management](./DEVICE_MANAGEMENT.md) |
49 | 56 | - [Network Tree Topology Setup](./NETWORK_TREE.md) |
50 | 57 | - [Notifications](./NOTIFICATIONS.md) |
51 | 58 |
|
52 | 59 |
|
53 | 60 | ## Other Tables overview |
54 | | - |
| 61 | + |
55 | 62 | | Table name | Description | Sample data | |
56 | | - |----------------------|----------------------| ----------------------| |
57 | | - | CurrentScan | Result of the current scan | ![Screen1][screen1] | |
58 | | - | Devices | The main devices database that also contains the Network tree mappings. If `ScanCycle` is set to `0` device is not scanned. | ![Screen2][screen2] | |
59 | | - | Events | Used to collect connection/disconnection events. | ![Screen4][screen4] | |
60 | | - | Online_History | Used to display the `Device presence` chart | ![Screen6][screen6] | |
61 | | - | Parameters | Used to pass values between the frontend and backend. | ![Screen7][screen7] | |
62 | | - | Plugins_Events | For capturing events exposed by a plugin via the `last_result.log` file. If unique then saved into the `Plugins_Objects` table. Entries are deleted once processed and stored in the `Plugins_History` and/or `Plugins_Objects` tables. | ![Screen10][screen10] | |
63 | | - | Plugins_History | History of all entries from the `Plugins_Events` table | ![Screen11][screen11] | |
64 | | - | Plugins_Language_Strings | Language strings collected from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] | |
65 | | - | Plugins_Objects | Unique objects detected by individual plugins. | ![Screen13][screen13] | |
66 | | - | Sessions | Used to display sessions in the charts | ![Screen15][screen15] | |
67 | | - | Settings | Database representation of the sum of all settings from `app.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] | |
| 63 | + |----------------------|----------------------| ----------------------| |
| 64 | + | CurrentScan | Result of the current scan | ![Screen1][screen1] | |
| 65 | + | Devices | The main devices database that also contains the Network tree mappings. If `ScanCycle` is set to `0` device is not scanned. | ![Screen2][screen2] | |
| 66 | + | Events | Used to collect connection/disconnection events. | ![Screen4][screen4] | |
| 67 | + | Online_History | Used to display the `Device presence` chart | ![Screen6][screen6] | |
| 68 | + | Parameters | Used to pass values between the frontend and backend. | ![Screen7][screen7] | |
| 69 | + | Plugins_Events | For capturing events exposed by a plugin via the `last_result.log` file. If unique then saved into the `Plugins_Objects` table. Entries are deleted once processed and stored in the `Plugins_History` and/or `Plugins_Objects` tables. | ![Screen10][screen10] | |
| 70 | + | Plugins_History | History of all entries from the `Plugins_Events` table | ![Screen11][screen11] | |
| 71 | + | Plugins_Language_Strings | Language strings collected from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] | |
| 72 | + | Plugins_Objects | Unique objects detected by individual plugins. | ![Screen13][screen13] | |
| 73 | + | Sessions | Used to display sessions in the charts | ![Screen15][screen15] | |
| 74 | + | Settings | Database representation of the sum of all settings from `app.conf` and plugins coming from `config.json` files. | ![Screen16][screen16] | |
68 | 75 |
|
69 | 76 |
|
70 | 77 |
|
71 | 78 | [screen1]: ./img/DATABASE/CurrentScan.png |
72 | 79 | [screen2]: ./img/DATABASE/Devices.png |
73 | | - [screen4]: ./img/DATABASE/Events.png |
| 80 | + [screen4]: ./img/DATABASE/Events.png |
74 | 81 | [screen6]: ./img/DATABASE/Online_History.png |
75 | 82 | [screen7]: ./img/DATABASE/Parameters.png |
76 | 83 | [screen10]: ./img/DATABASE/Plugins_Events.png |
77 | 84 | [screen11]: ./img/DATABASE/Plugins_History.png |
78 | 85 | [screen12]: ./img/DATABASE/Plugins_Language_Strings.png |
79 | | - [screen13]: ./img/DATABASE/Plugins_Objects.png |
| 86 | + [screen13]: ./img/DATABASE/Plugins_Objects.png |
80 | 87 | [screen15]: ./img/DATABASE/Sessions.png |
81 | 88 | [screen16]: ./img/DATABASE/Settings.png |
82 | 89 |
|
0 commit comments