Managing Device Checks & Alert Settings

We can add checks and define alert settings directly from the device page.

To add a check, you just need to select an available check type as shown below:

https://raw.githubusercontent.com/openwisp/openwisp-monitoring/docs/docs/1.1/device-inline-check.png

The following example shows how to use the OPENWISP_MONITORING_METRICS setting to reconfigure the system for iperf3 check to send an alert if the measured TCP bandwidth has been less than 10Mbit/s for more than 2 days.

1. By default, Iperf3 checks come with default alert settings, but it is easy to customize alert settings through the device page as shown below:

https://raw.githubusercontent.com/openwisp/openwisp-monitoring/docs/docs/1.1/device-inline-alertsettings.png
  1. Now, add the following notification configuration to send an alert for TCP bandwidth:

# Main project settings.py
from django.utils.translation import gettext_lazy as _

OPENWISP_MONITORING_METRICS = {
    "iperf3": {
        "notification": {
            "problem": {
                "verbose_name": "Iperf3 PROBLEM",
                "verb": _("Iperf3 bandwidth is less than normal value"),
                "level": "warning",
                "email_subject": _(
                    "[{site.name}] PROBLEM: {notification.target} {notification.verb}"
                ),
                "message": _(
                    "The device [{notification.target}]({notification.target_link}) "
                    "{notification.verb}."
                ),
            },
            "recovery": {
                "verbose_name": "Iperf3 RECOVERY",
                "verb": _("Iperf3 bandwidth now back to normal"),
                "level": "info",
                "email_subject": _(
                    "[{site.name}] RECOVERY: {notification.target} {notification.verb}"
                ),
                "message": _(
                    "The device [{notification.target}]({notification.target_link}) "
                    "{notification.verb}."
                ),
            },
        },
    },
}
https://raw.githubusercontent.com/openwisp/openwisp-monitoring/docs/docs/1.1/alert_field_warn.png
https://raw.githubusercontent.com/openwisp/openwisp-monitoring/docs/docs/1.1/alert_field_info.png

Note

To access the features described above, the user must have permissions for Check and AlertSetting inlines, these permissions are included by default in the "Administrator" and "Operator" groups and are shown in the screenshot below.

https://raw.githubusercontent.com/openwisp/openwisp-monitoring/docs/docs/1.1/inline-permissions.png