Skip to content

Commit

Permalink
📚 Better notification docs + exclude New Device eve if disabled Alert…
Browse files Browse the repository at this point in the history
… Events
  • Loading branch information
jokob-sk committed Oct 28, 2024
1 parent bb33ab1 commit 10ed589
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 18 deletions.
9 changes: 4 additions & 5 deletions docs/NOTIFICATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ There are 4 ways how to influence notifications:
> It's recommended to use the same schedule interval for all plugins responsible for scanning devices, otherwise false positives might be reported if different devices are discovered by different plugins. Check the **Settings** > **Enabled settings** section for a warning:
> ![Schedules out-of-sync](/docs/img/NOTIFICATIONS/Schedules_out-of-sync.png)

## Device settings 💻

![Device notification settings](/docs/img/NOTIFICATIONS/Device-notification-settings.png)

There are 4 settings on the device for influencing notifications. You can:

1. **Scan device** - Completely disable the scanning of the device
2. **Alert all events** - Enables extensive alerts of connections, disconnections, IP changes (noisy, usually not recommended)
3. **Alert down** - Alerts when a device goes down. This setting overrides disabled Alert All Events, so you will get a notification of a device going down even if you don't have **Alert All Events** ticked.
1. **Scan Device** - Completely disable the scanning of the device.
2. **Alert Events** - Enables alerts of connections, disconnections, IP changes.
3. **Alert Down** - Alerts when a device goes down. This setting overrides a disabled **Alert Events** setting, so you will get a notification of a device going down even if you don't have **Alert Events** ticked.
4. **Skip repeated notifications**, if for example you know there is a temporary issue and want to pause the same notification for this device for a given time.

## Plugin settings 🔌
Expand All @@ -40,7 +39,7 @@ Click the **Read more in the docs.** Link at the top of each plugin to get more

In Notification Processing settings, you can specify blanket rules. These allow you to specify exceptions to the Plugin and Device settings and will override those.

1. Notify on (`NTFPRCS_INCLUDED_SECTIONS`) allows you to specify which events trigger notifications. Usual setups will have `new_devices`, `down_devices`, and possibly `events` set. Setting `plugin` might be too noisy for most setups. More info in the [NTFPRCS plugin](/front/plugins/notification_processing/README.md)
1. Notify on (`NTFPRCS_INCLUDED_SECTIONS`) allows you to specify which events trigger notifications. Usual setups will have `new_devices`, `down_devices`, and possibly `down_reconnected` set. Including `plugin` (dependenton the Plugin `<plugin>_WATCH` and `<plugin>_REPORT_ON` settings) and `events` (dependent on the on-device **Alert Events** setting) might be too noisy for most setups. More info in the [NTFPRCS plugin](/front/plugins/notification_processing/README.md)
2. Alert down after (`NTFPRCS_alert_down_time`) is useful if you want to wait for some time before the system sends out a down notification for a device. This is related to the on-device **Alert down** setting and only devices with this checked will trigger a down notification.
3. A filter to allow you to set device-specific exceptions to New devices being added to the app.
4. A filter to allow you to set device-specific exceptions to generated Events.
Expand Down
15 changes: 10 additions & 5 deletions front/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,11 @@ input[readonly] {

.settingsSearchWrap
{
padding:10px;
/* padding:10px; */
/* display: flex; */
justify-content: center; /* Centers horizontally */
align-items: center; /* Centers vertically */
/* height: 60px; */
}

.settings-sticky-bottom-section {
Expand All @@ -1112,11 +1116,12 @@ input[readonly] {
/* opacity: 0.8; */
bottom: 30px;
border-radius: 5px;
margin:1px;
/* margin:1px; */
border-width: 1px;
border-style: solid;
border-color: inherit;
/* width: 87%; */
padding: 10px;
}

.settings-sticky-bottom-section:hover {
Expand All @@ -1135,7 +1140,7 @@ input[readonly] {
width: 14px;
position: absolute;
right: -6px;
top: 6px;
top: 13px;

}

Expand All @@ -1147,9 +1152,9 @@ input[readonly] {
.saveSettingsWrapper button
{
width:70%;
margin-top:20px;
/* margin-top:20px; */
margin-left:15%;
margin-bottom:20px;
/* margin-bottom:20px; */
}

#settingsPage .select2-selection
Expand Down
2 changes: 1 addition & 1 deletion front/php/templates/language/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"DAYS_TO_KEEP_EVENTS_name": "Delete events older than",
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copy details from device",
"DevDetail_Copy_Device_Tooltip": "Copy details from device from the dropdown list. Everything on this page will be overwritten",
"DevDetail_EveandAl_AlertAllEvents": "Alert All Events",
"DevDetail_EveandAl_AlertAllEvents": "Alert Events",
"DevDetail_EveandAl_AlertDown": "Alert Down",
"DevDetail_EveandAl_Archived": "Archived",
"DevDetail_EveandAl_NewDevice": "New Device",
Expand Down
Empty file modified front/php/templates/language/es_es.json
100644 → 100755
Empty file.
Empty file modified front/php/templates/language/it_it.json
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion front/plugins/events_notifications/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
"description": [
{
"language_code": "en_us",
"string": "Indicates whether events related to the device should trigger alerts. The default value of the <code>Alert All Events</code> checkbox."
"string": "Indicates whether events related to the device should trigger alerts. The default value of the <code>Alert Events</code> checkbox. Down and New Device notifications are always sent unless unselected in <code>NTFPRCS_INCLUDED_SECTIONS</code>."
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion front/plugins/notification_processing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Plugin supplying settings for Notification Processing.
- `new_devices` - if a new device is detected
- `down_devices` - if a device with **Alert down** enabled (on a specific Device) disconnects
- `down_reconnected` - if a device, previously marked down and notified on, reconnects
- `events` - if an event for a device that has **Alert All Events** enabled, is triggered
- `events` - if an event for a device that has **Alert Events** enabled, is triggered
- `plugins` - if an event for a plugin, is triggered


Expand Down
5 changes: 1 addition & 4 deletions front/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@


<section class=" settings-sticky-bottom-section col-sm-10 col-xs-12">
<div class="col-xs-8 settingsSearchWrap form-group has-success bg-white color-palette ">
<div class ="col-xs-8">
<i class="fa-solid fa-filter"></i> <?= lang("Gen_Filter");?>
</div>
<div class="col-xs-8 settingsSearchWrap has-success bg-white color-palette ">
<div class ="col-xs-12">

<input type="text" id="settingsSearch" class="form-control input-xs col-xs-12" placeholder="Filter Settings...">
Expand Down
2 changes: 1 addition & 1 deletion server/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_notifications (db):

# Disable reporting on events for devices where reporting is disabled based on the MAC address
sql.execute ("""UPDATE Events SET eve_PendingAlertEmail = 0
WHERE eve_PendingAlertEmail = 1 AND eve_EventType not in ('Device Down', 'Down Reconnected') AND eve_MAC IN
WHERE eve_PendingAlertEmail = 1 AND eve_EventType not in ('Device Down', 'Down Reconnected', 'New Device' ) AND eve_MAC IN
(
SELECT dev_MAC FROM Devices WHERE dev_AlertEvents = 0
)""")
Expand Down

0 comments on commit 10ed589

Please sign in to comment.