leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
406 stars 28 forks source link

[Bug] Getting notifications even though the option is turned off. #346

Closed DRIV3R78 closed 1 month ago

DRIV3R78 commented 1 month ago

Is there an existing issue for this?

Current Behavior

I selected all my devices (about 50) an deactivated the option "Alert Down". All checkboxes are unchecked. Still getting down notification emails.

I activated and deactivated the checkboxes but the behaviour does not change

Environment

Raspberry Pi 3 B+

Anything else?

No response

leiweibau commented 1 month ago

I selected all my devices (about 50) an deactivated the option "Alert Down". All checkboxes are unchecked.

Are all (“Alert All Events” and “Alert Down”) or only “Alert Down” deactivated? “Alert All Events” means all events. These would be IP changes, offline, online, changes between satellites and, depending on the modules used, also changes to the SSL certificate or HTTP status code changes.

When you open the Bulk Editor, you can see from the font color which notifications are activated for the individual hosts. If you don't want any notifications, they should all be white/black (depending on the theme). https://github.com/leiweibau/Pi.Alert/blob/main/docs/BULKEDITOR.md

DRIV3R78 commented 1 month ago

All checkboxes are unchecked. The devices are white in the bulk editor

IMG_1332

leiweibau commented 1 month ago

What you are showing me are the fields for editing. I mean the box at the top when you open the bulk editor

https://raw.githubusercontent.com/leiweibau/Pi.Alert/assets/bulkeditor_list.png

EDIT: What is the context of the notification? Are you testing this with a Docker container or a “real” host?

DRIV3R78 commented 1 month ago

It is a fresh Raspberry Installation (64bit Bullseye) with your installation line bash -c "$(wget -qLO - https://github.com/leiweibau/Pi.Alert/raw/main/install/pialert_install.sh)"

Bulk

leiweibau commented 1 month ago

Is it a “Devices Down” or an “Events” notification? Does this only occur with a specific host, or with all hosts?

EDIT: You already answered the first question at the beginning 🤦‍♂️

EDIT: I know of a slightly older YouTube video in which the creator very confidently changes the scan interval in the crontab. Did you do that by any chance? This can possibly lead to unpredictable errors.

DRIV3R78 commented 1 month ago

Hi,

I change nothing except the subnets to scan. Maybe the issue is related to rights?

I have no issues except the message thing.

At first I forgot to use sudo with the installation command with I caught up on.

leiweibau commented 1 month ago

Maybe the issue is related to rights?

No, I don't think so yet, otherwise the scan wouldn't even start. Apart from that, the database itself is checked for the correct permissions before the scan and set if necessary.

You can run the “Delete Events” function under “Settings” -> “Maintenance” and check whether the error disappears.

At first I forgot to use sudo with the installation command with I caught up on

That should be less of a problem. If the command is executed with sudo, Pi.Alert is installed under the user root, otherwise under the current user. In either case, 2 files are created under “/etc/sudoers.d/”, which take care of the necessary permissions.

DRIV3R78 commented 1 month ago

I deleted the events. Unfortunatly the problem persists. Can I debug this?

leiweibau commented 1 month ago

Can I debug this?

  1. Does this only occur with a specific host, or with all hosts?
  2. Check db file permissions
  3. Check "Last Update" on the settings page (status box)
  4. What does the “Scan” log look like (Settings page -> Log Viewer)?
  5. You wrote that you tried to install it before without sudo. Is this installation still available? Does the cronjob of the user in question still exist?

If it is possible, you could do a clean reinstallation

DRIV3R78 commented 1 month ago
  1. it occurs with all hosts
  2. How do ich check the db file permissions.
  3. Last Update is 27.07. 16:15
  4. Pi.Alert v2024-07-17
    
    `---------------------------------------------------------
    Executing user: root

Scan Devices Timestamp: 2024-07-27 16:15:00

Scanning... arp-scan Method... arp-scan: Multiple interfaces Pi-hole Method... ...Skipped DHCP Leases Method... ...Skipped Fritzbox Method... ...Skipped Mikrotik Method... ...Skipped UniFi Method... ...Skipped Satellite Import... ...Skipped

Processing scan results... Processing ignore list... Ignore list is empty Devices Detected.......: 58 arp-scan Method....: 56 Pi-hole Method.....: +0 Fritzbox Method....: +0 Mikrotik Method....: +0 UniFi Method.......: +0 New Devices........: 0

Devices in this scan...: 58
    Down Alerts........: 0
    New Down Alerts....: 0
    New Connections....: 3
    Disconnections.....: 1
    IP Changes.........: 0

Updating DB Info... Sessions Events (connect / discconnect) ... Creating new devices... Updating Devices Info... Trying to resolve devices without name........................



5. Yes I think so :(

I will try to do a clean reinstall.
Somethinfg is broken. I deativated messages (False) but I still get notifications via mail.
leiweibau commented 1 month ago

As you can see in the log, no "Down Alert" is triggered here.

If you enter "crontab -e" (without "sudo") in the terminal, you can edit the user cronjobs. Just do a # before each pialert cronjob and check if the error disappears

DRIV3R78 commented 1 month ago

I’ve done a clean install yesterday evening and the message problem disappeared.

Seems that it had to do with my second installation which I accidentally did.

You can close this issue. Thanks for your help.

leiweibau commented 1 month ago

You're welcome