Add filter for delayed alerts

my work place is used to zenoss’ way to display warning and critical in different colors and events only turn critical after retries and delayed. when I introduce librenms, they feel strongly against the alert widget and alerts panel due to librenms has different concept of warning and different ways of alert.

Since my colleagues are used to watch display screen instead of email or other transporter, it is big concern for them if false/non-confirmed alerts keep showing on the dashboard. Although I have gone through the librenms performance tips and followed the procedures, we are still getting false alerts for Device up/down. Therefore, I decided to customize the display and only show delayed alerts, which is confirmed and sure.

I have made the changes on alert widget and it is working as expected so far. I thought someone else may want this feature as well. hereby, I provide my changes below and please import into code.

[[email protected] ~]# diff original/ /opt/librenms/html/includes/common/
>     $current_delayed =  isset($widget_settings['delayed']) ? $widget_settings['delayed'] : '';
>       <label for="delayed" class="control-label">Show only delayed alerts: </label>
>     </div>
>     <div class="col-sm-8">
>       <select class="form-control" name="delayed">';
>     $common_output[] = '<option value=""' . ($current_delayed == '' ? ' selected' : ' ') . '>not filtered</option>';
>     $common_output[] = '<option value="1"' . ($current_delayed == '1' ? ' selected' : ' ') . '>show only delayed alerts</option>';
>     $common_output[] = '
>       </select>
>     </div>
>   </div>
>   <div class="form-group row">
>     <div class="col-sm-4">
>     $delayed = $widget_settings['delayed'];
>     if (is_numeric($delayed)) {
>        $title = "Delayed $title";
>     }
>     }
>     if (is_numeric($delayed)) {
>         $common_output[] = "delayed: '$delayed',\n";
[[email protected] ~]# diff original/ /opt/librenms/html/includes/table/
> if (is_numeric($vars['delayed'])) {
>    $where .= " AND `alerts`.`alerted`=" . $alert_states['alerted'];
> }

Thanks and regards,

If you would like to share with others, please create a “pull request” on github.

Here is some documentation:

You should read the using git section at least.

Hi, I have made pull request accordingly. Please have a look.


It seems that this patch has not been applied. We also need to filter delayed alerts on alert history.