From 4b0074af9f51cdd1168b3101907f51f1b70c9d06 Mon Sep 17 00:00:00 2001 From: Unnati gupta Date: Fri, 21 Feb 2025 14:46:55 +0530 Subject: [PATCH 1/3] [docs] Add information about default alert settings #611 fixes #611 --- .../user/device-checks-and-alert-settings.rst | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/docs/user/device-checks-and-alert-settings.rst b/docs/user/device-checks-and-alert-settings.rst index addc0f58..e8fbdf3f 100644 --- a/docs/user/device-checks-and-alert-settings.rst +++ b/docs/user/device-checks-and-alert-settings.rst @@ -1,6 +1,69 @@ Managing Device Checks & Alert Settings ======================================= +**Overview of default checks** + +1. Ping Check +------------ +* **Triggers when**: Value is less than 1 +* **Wait time**: 0 minutes (immediate) +* **Sets status**: Critical +* **Meaning**: Device is unreachable + +2. Config Applied Check +--------------------- +* **Triggers when**: Value is less than 1 +* **Wait time**: 5 minutes +* **Sets status**: Problem +* **Meaning**: Configuration hasn't been updated for over 5 minutes + +3. WiFi Clients Check +------------------- +Maximum: +^^^^^^^^ +* **Triggers when**: More than 50 clients +* **Wait time**: 120 minutes (2 hours) +* **Sets status**: Problem +* **Meaning**: Too many clients connected + +Minimum: +^^^^^^^^ +* **Triggers when**: Less than 1 client +* **Wait time**: 0 minutes (immediate) +* **Sets status**: Problem +* **Meaning**: No clients connected + +4. Disk Usage Check +----------------- +* **Triggers when**: Usage exceeds 90% +* **Wait time**: 0 minutes (immediate) +* **Sets status**: Problem +* **Meaning**: Disk space is nearly full + +5. Memory Usage Check +------------------- +* **Triggers when**: Usage exceeds 95% +* **Wait time**: 5 minutes +* **Sets status**: Problem +* **Meaning**: High memory consumption persists + +6. CPU Usage Check +---------------- +* **Triggers when**: Usage exceeds 90% +* **Wait time**: 5 minutes +* **Sets status**: Problem +* **Meaning**: High CPU load persists + +7. Iperf3 Check +-------------- +.. note:: + This check is disabled by default + +* **Triggers when**: Value is less than 1 +* **Wait time**: 0 minutes (immediate) +* **Sets status**: Problem +* **Meaning**: Network performance test failed + We can add checks and define alert settings directly from the **device page**. From 40117b1be635efd0b57e7431b3293e204840c790 Mon Sep 17 00:00:00 2001 From: Unnati gupta Date: Fri, 21 Feb 2025 15:23:25 +0530 Subject: [PATCH 2/3] [docs] Add information about default alert settings #611 fixes #611 --- docs/user/device-checks-and-alert-settings.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/user/device-checks-and-alert-settings.rst b/docs/user/device-checks-and-alert-settings.rst index e8fbdf3f..8799f492 100644 --- a/docs/user/device-checks-and-alert-settings.rst +++ b/docs/user/device-checks-and-alert-settings.rst @@ -54,16 +54,6 @@ Minimum: * **Sets status**: Problem * **Meaning**: High CPU load persists -7. Iperf3 Check --------------- -.. note:: - This check is disabled by default - -* **Triggers when**: Value is less than 1 -* **Wait time**: 0 minutes (immediate) -* **Sets status**: Problem -* **Meaning**: Network performance test failed - We can add checks and define alert settings directly from the **device page**. From c07471eaa605a47948401ccfb9aa72cad5cb0b50 Mon Sep 17 00:00:00 2001 From: Unnati-Gupta24 Date: Sun, 23 Feb 2025 22:58:52 +0530 Subject: [PATCH 3/3] [docs] Add information about default alert settings #611 Fixes #611 --- docs/user/device-checks-and-alert-settings.rst | 12 ++++++------ openwisp_monitoring/device/base/models.py | 5 +---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/user/device-checks-and-alert-settings.rst b/docs/user/device-checks-and-alert-settings.rst index 8799f492..a579cc5a 100644 --- a/docs/user/device-checks-and-alert-settings.rst +++ b/docs/user/device-checks-and-alert-settings.rst @@ -4,21 +4,21 @@ Managing Device Checks & Alert Settings **Overview of default checks** 1. Ping Check ------------- +------------- * **Triggers when**: Value is less than 1 * **Wait time**: 0 minutes (immediate) * **Sets status**: Critical * **Meaning**: Device is unreachable 2. Config Applied Check ---------------------- +----------------------- * **Triggers when**: Value is less than 1 * **Wait time**: 5 minutes * **Sets status**: Problem * **Meaning**: Configuration hasn't been updated for over 5 minutes 3. WiFi Clients Check -------------------- +--------------------- Maximum: ^^^^^^^^ * **Triggers when**: More than 50 clients @@ -34,21 +34,21 @@ Minimum: * **Meaning**: No clients connected 4. Disk Usage Check ------------------ +------------------- * **Triggers when**: Usage exceeds 90% * **Wait time**: 0 minutes (immediate) * **Sets status**: Problem * **Meaning**: Disk space is nearly full 5. Memory Usage Check -------------------- +--------------------- * **Triggers when**: Usage exceeds 95% * **Wait time**: 5 minutes * **Sets status**: Problem * **Meaning**: High memory consumption persists 6. CPU Usage Check ----------------- +------------------ * **Triggers when**: Usage exceeds 90% * **Wait time**: 5 minutes * **Sets status**: Problem diff --git a/openwisp_monitoring/device/base/models.py b/openwisp_monitoring/device/base/models.py index 1d263da4..bb97ee83 100644 --- a/openwisp_monitoring/device/base/models.py +++ b/openwisp_monitoring/device/base/models.py @@ -319,10 +319,7 @@ def save_wifi_clients_and_sessions(self): active_sessions.append(session_obj.pk) # Close open WifiSession - WifiSession.objects.filter( - device_id=self.id, - stop_time=None, - ).exclude( + WifiSession.objects.filter(device_id=self.id, stop_time=None,).exclude( pk__in=active_sessions ).update(stop_time=now())