diff --git a/docs/user/device-checks-and-alert-settings.rst b/docs/user/device-checks-and-alert-settings.rst index addc0f58..a579cc5a 100644 --- a/docs/user/device-checks-and-alert-settings.rst +++ b/docs/user/device-checks-and-alert-settings.rst @@ -1,6 +1,59 @@ 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 + We can add checks and define alert settings directly from the **device page**. 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())