jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.05k stars 184 forks source link

PiAlert constantly reloading #270

Closed YoSafeguard closed 1 year ago

YoSafeguard commented 1 year ago

Describe the issue

After the last update, PiAlert constantly reboots (about once an hour). Installed on Docker NAS Synology according to MariusHosting instructions

Paste last few lines from pialert.log

You can use tail -20 /home/pi/pialert/front/log/pialert.log

10:27:24 [Process Scan] Stats end
10:27:24 [Process Scan] Updating DB Info
10:27:24 [Process Scan] Sessions Events (connect / discconnect)
10:27:24 [Process Scan] Creating new devices
10:27:24 [Process Scan] Updating Devices Info
10:27:24 [Process Scan] Resolve devices names
10:27:24 [Process Scan] Voiding false (ghost) disconnections
10:27:24 [Process Scan] Pairing session events (connection / disconnection) 
10:27:25 [Process Scan] Creating sessions snapshot
10:27:25 [Process Scan] Inserting scan results into Online_History
10:27:25 [Process Scan] Skipping repeated notifications
10:27:25 [Skip Repeated Notifications] Skip Repeated start
10:27:25 [Skip Repeated Notifications] Skip Repeated end
10:27:25 [MAIN] Process: Wait
10:27:30 [API] Update API starting
10:27:30 [MAIN] waiting to start next loop
10:27:35 [API] Update API starting
10:27:35 [MAIN] waiting to start next loop
10:27:40 [API] Update API starting
10:27:40 [MAIN] waiting to start next loop
10:27:46 [API] Update API starting
10:27:46 [MAIN] waiting to start next loop
10:27:51 [API] Update API starting
10:27:51 [MAIN] waiting to start next loop
10:27:56 [API] Update API starting
10:27:56 [MAIN] waiting to start next loop
10:28:01 [API] Update API starting
10:28:01 [MAIN] waiting to start next loop
10:28:07 [API] Update API starting
10:28:07 [MAIN] waiting to start next loop
10:28:12 [API] Update API starting
10:28:12 [MAIN] waiting to start next loop
10:28:17 [API] Update API starting
10:28:17 [MAIN] waiting to start next loop
10:28:22 [API] Update API starting
10:28:22 [MAIN] waiting to start next loop
10:28:28 [API] Update API starting
10:28:28 [Internet IP] Check Internet IP started
10:28:28 [Internet IP] - Retrieving Internet IP
10:28:28 [Internet IP] IP:      0.0.0.0
10:28:28 [Internet IP]    Retrieving previous IP:
10:28:28 [Internet IP]      0.0.0.0
10:28:28 [Internet IP]    No changes to perform
10:28:28 [DDNS]     Skipping Dynamic DNS update
10:28:28 [Process Scan]  Processing scan results
10:28:28 [Process Scan] Print Stats
10:28:28 [Scan Stats]    Devices Detected.......: 0
10:28:28 [Scan Stats]        arp-scan detected..: 0
10:28:28 [Scan Stats]        Pi-hole detected...: +0
10:28:28 [Scan Stats]        New Devices........: 0
10:28:28 [Scan Stats]    Devices in this cycle..: 0
10:28:28 [Scan Stats]        Down Alerts........: 0
10:28:28 [Scan Stats]        New Down Alerts....: 0
10:28:28 [Scan Stats]        New Connections....: 0
10:28:28 [Scan Stats]        Disconnections.....: 0
10:28:28 [Scan Stats]        IP Changes.........: 0
10:28:28 [Process Scan] Stats end
10:28:28 [Process Scan] Updating DB Info
10:28:28 [Process Scan] Sessions Events (connect / discconnect)
10:28:28 [Process Scan] Creating new devices
10:28:28 [Process Scan] Updating Devices Info
10:28:28 [Process Scan] Resolve devices names
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pi/pialert/pialert/__main__.py", line 314, in <module>
    sys.exit(main())       
  File "/home/pi/pialert/pialert/__main__.py", line 163, in main
    run_plugin_scripts(db,'schedule') 
  File "/home/pi/pialert/pialert/plugin.py", line 38, in run_plugin_scripts
    shouldRun = schd.runScheduleCheck()  
  File "/home/pi/pialert/pialert/scheduler.py", line 30, in runScheduleCheck
    if nowTime > self.last_next_schedule and self.last_run < self.last_next_schedule:
TypeError: can't compare offset-naive and offset-aware datetimes
10:28:28 [Process Scan] Voiding false (ghost) disconnections
10:28:28 [Process Scan] Pairing session events (connection / disconnection) 
10:28:28 [Process Scan] Creating sessions snapshot
10:28:28 [Process Scan] Inserting scan results into Online_History
10:28:28 [Process Scan] Skipping repeated notifications
10:28:28 [Skip Repeated Notifications] Skip Repeated start
10:28:28 [Skip Repeated Notifications] Skip Repeated end
10:28:28 [Notification] Check if something to report
10:28:28 [Notification] Open text Template
10:28:28 [Notification] Open html Template
10:28:28 [Notification] included sections: ['internet', 'new_devices', 'down_devices', 'events']
10:28:28 [Notification] Internet sections done.
10:28:28 [Notification] New Devices sections done.
10:28:28 [Notification] Down Devices sections done.
10:28:28 [Notification] Events sections done.
10:28:28 [Notification] No changes to report
10:28:28 [Notification] Notifications changes: 0
10:28:28 [MAIN] Last action: internet_IP
10:28:28 [MAIN] cycle:
10:28:28 [MAIN] Process: Wait
10:28:33 [API] Update API starting
10:28:33 [MAIN] waiting to start next loop
10:28:39 [API] Update API starting
10:28:39 [MAIN] waiting to start next loop
10:28:44 [API] Update API starting
10:28:44 [MAIN] waiting to start next loop
10:28:49 [API] Update API starting
10:28:49 [MAIN] waiting to start next loop
10:28:54 [API] Update API starting
10:28:54 [MAIN] waiting to start next loop
10:29:00 [API] Update API starting
10:29:00 [MAIN] waiting to start next loop
10:29:05 [API] Update API starting
10:29:05 [MAIN] waiting to start next loop
10:29:10 [API] Update API starting
10:29:10 [MAIN] waiting to start next loop
10:29:15 [API] Update API starting
10:29:15 [MAIN] waiting to start next loop
10:29:21 [API] Update API starting
10:29:21 [MAIN] waiting to start next loop
10:29:26 [API] Update API starting
10:29:26 [MAIN] waiting to start next loop
10:29:31 [API] Update API starting
10:29:31 [Process Scan]  Processing scan results
10:29:32 [Process Scan] Print Stats
10:29:32 [Scan Stats]    Devices Detected.......: 0
10:29:32 [Scan Stats]        arp-scan detected..: 0
10:29:32 [Scan Stats]        Pi-hole detected...: +0
10:29:32 [Scan Stats]        New Devices........: 0
10:29:32 [Scan Stats]    Devices in this cycle..: 0
10:29:32 [Scan Stats]        Down Alerts........: 0
10:29:32 [Scan Stats]        New Down Alerts....: 0
10:29:32 [Scan Stats]        New Connections....: 0
10:29:32 [Scan Stats]        Disconnections.....: 0
10:29:32 [Scan Stats]        IP Changes.........: 0
10:29:32 [Process Scan] Stats end
10:29:32 [Process Scan] Updating DB Info
10:29:32 [Process Scan] Sessions Events (connect / discconnect)
10:29:32 [Process Scan] Creating new devices
10:29:32 [Process Scan] Updating Devices Info
10:29:32 [Process Scan] Resolve devices names
10:29:32 [Process Scan] Voiding false (ghost) disconnections
10:29:32 [Process Scan] Pairing session events (connection / disconnection) 
10:29:32 [Process Scan] Creating sessions snapshot
10:29:32 [Process Scan] Inserting scan results into Online_History
10:29:32 [Process Scan] Skipping repeated notifications
10:29:32 [Skip Repeated Notifications] Skip Repeated start
10:29:32 [Skip Repeated Notifications] Skip Repeated end
10:29:32 [MAIN] Process: Wait
10:29:37 [API] Update API starting
10:29:37 [MAIN] waiting to start next loop
10:29:42 [API] Update API starting
10:29:42 [MAIN] waiting to start next loop
10:29:47 [API] Update API starting
10:29:47 [MAIN] waiting to start next loop
10:29:53 [API] Update API starting
10:29:53 [MAIN] waiting to start next loop
10:29:58 [API] Update API starting
10:29:58 [MAIN] waiting to start next loop
10:30:03 [API] Update API starting
10:30:03 [MAIN] waiting to start next loop
10:30:08 [API] Update API starting
10:30:08 [MAIN] waiting to start next loop
10:30:14 [API] Update API starting
10:30:14 [MAIN] waiting to start next loop
10:30:19 [API] Update API starting
10:30:19 [MAIN] waiting to start next loop
10:30:24 [API] Update API starting
10:30:24 [MAIN] waiting to start next loop
10:30:29 [API] Update API starting
10:30:29 [MAIN] waiting to start next loop
10:30:35 [API] Update API starting
mkdir: cannot create directory '/run/php': File exists
Starting nginx: nginx.
pcap_activate: eth1: No such device exists
(SIOCGIFHWADDR: No such device)
WARNING: host part of 77.40.53.253/24 is non-zero


10:35:06 Permissions check (All should be True)
10:35:06 ------------------------------------------------
10:35:06   /config/pialert.conf |  READ  | True
10:35:06   /config/pialert.conf |  WRITE | True
10:35:06   /db/pialert.db       |  READ  | True
10:35:06   /db/pialert.db       |  WRITE | True
10:35:06 ------------------------------------------------
10:35:06 [Setup] Attempting to fix permissions.
10:35:06 [Setup] Attempting to fix permissions.
10:35:06 [Database] Opening DB
10:35:06 [upgradeDB] Re-creating Settings table
10:35:06 [upgradeDB] Re-creating Parameters table
10:35:06 [Config] reading config file
10:35:06 [Config] Plugins: Number of dynamically loaded plugins: 7
10:35:06 [Plugins] ---------------------------------------------
10:35:06 [Plugins] display_name: DHCP Leases
10:35:06 [Plugins] description: This plugin is to import devices from dhcp.leases files.
10:35:06 [Plugins] ---------------------------------------------
10:35:06 [Plugins] display_name: Rogue DHCP
10:35:06 [Plugins] description: This plugin is to use NMAP to monitor for rogue DHCP servers.
10:35:06 [Plugins] ---------------------------------------------
10:35:06 [Plugins] display_name: Services (NMAP)
10:35:06 [Plugins] description: This plugin shows all services discovered by NMAP scans.
10:35:06 [Plugins] ---------------------------------------------
10:35:06 [Plugins] display_name: SNMP discovery
10:35:06 [Plugins] description: This plugin is used to discover devices via the arp table(s) of a RFC1213 compliant router or switch.
10:35:07 [Plugins] ---------------------------------------------
10:35:07 [Plugins] display_name: Un-Discoverable Devices
10:35:07 [Plugins] description: This plugin is to import undiscoverable devices from a file.
10:35:07 [Plugins] ---------------------------------------------
10:35:07 [Plugins] display_name: UniFi import
10:35:07 [Plugins] description: This plugin is used to import devices from an UNIFI controller.
10:35:07 [Plugins] ---------------------------------------------
10:35:07 [Plugins] display_name: Website monitor
10:35:07 [Plugins] description: This plugin is to monitor status changes of services or websites.
10:35:08 [API] Update API starting
10:35:08 [API] Updating table_settings.json file in /front/api
10:35:08 [Config] Imported new config
10:35:08 [API] Update API starting
10:35:08 [API] Updating table_devices.json file in /front/api
10:35:08 [API] Updating table_nmap_scan.json file in /front/api
10:35:08 [API] Updating table_pholus_scan.json file in /front/api
10:35:08 [API] Updating table_events_pending_alert.json file in /front/api
10:35:08 [API] Updating table_plugins_events.json file in /front/api
10:35:08 [API] Updating table_plugins_history.json file in /front/api
10:35:08 [API] Updating table_plugins_objects.json file in /front/api
10:35:08 [API] Updating table_language_strings.json file in /front/api
10:35:08 [API] Updating table_custom_endpoint.json file in /front/api
10:35:09 [Internet IP] Check Internet IP started
10:35:09 [Internet IP] - Retrieving Internet IP
10:35:09 [Internet IP] IP:      0.0.0.0
10:35:09 [Internet IP]    Retrieving previous IP:
10:35:09 [Internet IP]      0.0.0.0
10:35:09 [Internet IP]    No changes to perform
10:35:09 [DDNS]     Skipping Dynamic DNS update
10:35:09 [PholusScan] Scan: Pholus for 600s (10.0min)
10:35:09 [PholusScan] Pholus scan on [interface] eth1 [mask] 192.168.1.0/24
10:35:09 [PholusScan] Scan: Pholus SUCCESS
10:35:09 [PholusScan] Scan: Pholus for 600s (10.0min)
10:35:09 [PholusScan] Pholus scan on [interface] eth0 [mask] 192.168.1.0/24
10:35:47 [PholusScan] Scan: Pholus SUCCESS
10:35:49 [PholusScan] Scan: Pholus for 600s (10.0min)
10:35:49 [PholusScan] Pholus scan on [interface] eth0 [mask] 77.40.53.253/24
10:35:51 [PholusScan]source MAC address:00:11:32:cd:94:27source IPv4 Address:192.168.1.120source IPv6 address:fe80::211:32ff:fecd:9427
Sniffer filter is: not ether src 00:11:32:cd:94:27 and udp and port 5353
I will sniff for 300.0 seconds, unless interrupted by Ctrl-C
------------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pi/pialert/pholus/pholus3.py", line 1192, in <module>
    main()
  File "/home/pi/pialert/pholus/pholus3.py", line 1062, in main
    ipn = ipaddress.ip_network(values.rdns_scanning)
  File "/usr/lib/python3.9/ipaddress.py", line 74, in ip_network
    return IPv4Network(address, strict)
  File "/usr/lib/python3.9/ipaddress.py", line 1504, in __init__
    raise ValueError('%s has host bits set' % self)
ValueError: 77.40.53.253/24 has host bits set
10:35:51 [PholusScan] Error - Pholus Scan - check logs
10:35:51 [PholusScan] Scan: Pholus FAIL - check logs
10:35:51 [MAIN] cycle:1
10:35:51 [Network Scan] Scan Devices:
10:35:51 [Network Scan] arp-scan start
10:35:51 [ARP Scan]
10:36:13 [Network Scan] arp-scan ends
10:36:13 [Process Scan]  Processing scan results
10:36:14 [Process Scan] Print Stats
10:36:14 [Scan Stats]    Devices Detected.......: 26
10:36:14 [Scan Stats]        arp-scan detected..: 24
10:36:14 [Scan Stats]        Pi-hole detected...: +0
10:36:14 [Scan Stats]        New Devices........: 0
10:36:14 [Scan Stats]    Devices in this cycle..: 26
10:36:14 [Scan Stats]        Down Alerts........: 9
10:36:14 [Scan Stats]        New Down Alerts....: 0
10:36:14 [Scan Stats]        New Connections....: 0
10:36:14 [Scan Stats]        Disconnections.....: 0
10:36:14 [Scan Stats]        IP Changes.........: 0
10:36:14 [Process Scan] Stats end
10:36:14 [Process Scan] Updating DB Info
10:36:14 [Process Scan] Sessions Events (connect / discconnect)
10:36:14 [Process Scan] Creating new devices
10:36:14 [Process Scan] Updating Devices Info
10:36:14 [Process Scan] Resolve devices names
10:36:14 [Process Scan] Voiding false (ghost) disconnections
10:36:14 [Process Scan] Pairing session events (connection / disconnection) 
10:36:14 [Process Scan] Creating sessions snapshot
10:36:14 [Process Scan] Inserting scan results into Online_History
10:36:14 [Process Scan] Skipping repeated notifications
10:36:14 [Skip Repeated Notifications] Skip Repeated start
10:36:14 [Skip Repeated Notifications] Skip Repeated end
10:36:14 [Notification] Check if something to report
10:36:14 [Notification] Open text Template
10:36:14 [Notification] Open html Template
10:36:14 [Notification] included sections: ['internet', 'new_devices', 'down_devices', 'events']
10:36:14 [Notification] Internet sections done.
10:36:14 [Notification] New Devices sections done.
10:36:14 [Notification] Down Devices sections done.
10:36:14 [Notification] Events sections done.
10:36:14 [Notification] No changes to report
10:36:14 [Notification] Notifications changes: 0
10:36:14 [MAIN] cycle:cleanup
10:36:14 [DB Cleanup] Upkeep Database:
10:36:14 [DB Cleanup] Online_History: Delete all but keep latest 150 entries
10:36:14 [DB Cleanup] Optimize Database
10:36:14 [DB Cleanup] Events: Delete all older than 90 days
10:36:14 [DB Cleanup] Plugin Events History: Delete all older than 90 days
10:36:14 [DB Cleanup] Pholus_Scan: Delete all older than 7 days
10:36:14 [DB Cleanup] Pholus_Scan: Delete all duplicates
10:36:14     Nmap_Scan: Delete all duplicates
10:36:14     Shrink Database
10:36:14 [MAIN] Last action: cleanup
10:36:14 [MAIN] cycle:
10:36:14 [MAIN] Process: Wait
10:36:20 [API] Update API starting
10:36:20 [API] Updating table_pholus_scan.json file in /front/api
10:36:20 [Process Scan]  Processing scan results
10:36:20 [Process Scan] Print Stats
10:36:20 [Scan Stats]    Devices Detected.......: 0
10:36:20 [Scan Stats]        arp-scan detected..: 0
10:36:20 [Scan Stats]        Pi-hole detected...: +0
10:36:20 [Scan Stats]        New Devices........: 0
10:36:20 [Scan Stats]    Devices in this cycle..: 0
10:36:20 [Scan Stats]        Down Alerts........: 0
10:36:20 [Scan Stats]        New Down Alerts....: 0
10:36:20 [Scan Stats]        New Connections....: 0
10:36:20 [Scan Stats]        Disconnections.....: 0
10:36:20 [Scan Stats]        IP Changes.........: 0
10:36:20 [Process Scan] Stats end
10:36:20 [Process Scan] Updating DB Info
10:36:20 [Process Scan] Sessions Events (connect / discconnect)
10:36:20 [Process Scan] Creating new devices
10:36:20 [Process Scan] Updating Devices Info
10:36:20 [Process Scan] Resolve devices names
10:36:20 [Process Scan] Voiding false (ghost) disconnections
10:36:20 [Process Scan] Pairing session events (connection / disconnection) 
10:36:20 [Process Scan] Creating sessions snapshot
10:36:20 [Process Scan] Inserting scan results into Online_History
10:36:20 [Process Scan] Skipping repeated notifications
10:36:20 [Skip Repeated Notifications] Skip Repeated start
10:36:20 [Skip Repeated Notifications] Skip Repeated end
10:36:20 [MAIN] Process: Wait
10:36:25 [API] Update API starting
10:36:25 [MAIN] waiting to start next loop
10:36:31 [API] Update API starting
10:36:31 [MAIN] waiting to start next loop
10:36:36 [API] Update API starting
10:36:36 [MAIN] waiting to start next loop
10:36:41 [API] Update API starting
10:36:41 [MAIN] waiting to start next loop
10:36:46 [API] Update API starting
10:36:46 [MAIN] waiting to start next loop
10:36:52 [API] Update API starting
10:36:52 [MAIN] waiting to start next loop
10:36:57 [API] Update API starting
10:36:57 [MAIN] waiting to start next loop
10:37:02 [API] Update API starting
10:37:02 [MAIN] waiting to start next loop
10:37:07 [API] Update API starting
10:37:07 [MAIN] waiting to start next loop
10:37:13 [API] Update API starting
10:37:13 [MAIN] waiting to start next loop
10:37:18 [API] Update API starting
10:37:18 [MAIN] waiting to start next loop
10:37:23 [API] Update API starting
10:37:23 [Process Scan]  Processing scan results
10:37:24 [Process Scan] Print Stats
10:37:24 [Scan Stats]    Devices Detected.......: 0
10:37:24 [Scan Stats]        arp-scan detected..: 0
10:37:24 [Scan Stats]        Pi-hole detected...: +0
10:37:24 [Scan Stats]        New Devices........: 0
10:37:24 [Scan Stats]    Devices in this cycle..: 0
10:37:24 [Scan Stats]        Down Alerts........: 0
10:37:24 [Scan Stats]        New Down Alerts....: 0
10:37:24 [Scan Stats]        New Connections....: 0
10:37:24 [Scan Stats]        Disconnections.....: 0
10:37:24 [Scan Stats]        IP Changes.........: 0
10:37:24 [Process Scan] Stats end
10:37:24 [Process Scan] Updating DB Info
10:37:24 [Process Scan] Sessions Events (connect / discconnect)
10:37:24 [Process Scan] Creating new devices
10:37:24 [Process Scan] Updating Devices Info
10:37:24 [Process Scan] Resolve devices names
10:37:24 [Process Scan] Voiding false (ghost) disconnections
10:37:24 [Process Scan] Pairing session events (connection / disconnection) 
10:37:24 [Process Scan] Creating sessions snapshot
10:37:24 [Process Scan] Inserting scan results into Online_History
10:37:24 [Process Scan] Skipping repeated notifications
10:37:24 [Skip Repeated Notifications] Skip Repeated start
10:37:24 [Skip Repeated Notifications] Skip Repeated end
10:37:24 [MAIN] Process: Wait
10:37:29 [API] Update API starting
10:37:29 [MAIN] waiting to start next loop
10:37:34 [API] Update API starting
10:37:34 [MAIN] waiting to start next loop
10:37:39 [API] Update API starting
10:37:39 [MAIN] waiting to start next loop
10:37:45 [API] Update API starting
10:37:45 [MAIN] waiting to start next loop
10:37:50 [API] Update API starting
10:37:50 [MAIN] waiting to start next loop
10:37:55 [API] Update API starting
10:37:55 [MAIN] waiting to start next loop
10:38:00 [API] Update API starting
10:38:00 [MAIN] waiting to start next loop
10:38:06 [API] Update API starting
10:38:06 [MAIN] waiting to start next loop
10:38:11 [API] Update API starting
10:38:11 [MAIN] waiting to start next loop
10:38:16 [API] Update API starting
10:38:16 [MAIN] waiting to start next loop
10:38:21 [API] Update API starting
10:38:21 [MAIN] waiting to start next loop
10:38:27 [API] Update API starting
10:38:27 [Internet IP] Check Internet IP started
10:38:27 [Internet IP] - Retrieving Internet IP
10:38:27 [Internet IP] IP:      0.0.0.0
10:38:27 [Internet IP]    Retrieving previous IP:
10:38:27 [Internet IP]      0.0.0.0
10:38:27 [Internet IP]    No changes to perform
10:38:27 [DDNS]     Skipping Dynamic DNS update
10:38:27 [Process Scan]  Processing scan results
10:38:27 [Process Scan] Print Stats
10:38:27 [Scan Stats]    Devices Detected.......: 0
10:38:27 [Scan Stats]        arp-scan detected..: 0
10:38:27 [Scan Stats]        Pi-hole detected...: +0
10:38:27 [Scan Stats]        New Devices........: 0
10:38:27 [Scan Stats]    Devices in this cycle..: 0
10:38:27 [Scan Stats]        Down Alerts........: 0
10:38:27 [Scan Stats]        New Down Alerts....: 0
10:38:27 [Scan Stats]        New Connections....: 0
10:38:27 [Scan Stats]        Disconnections.....: 0
10:38:27 [Scan Stats]        IP Changes.........: 0
10:38:27 [Process Scan] Stats end
10:38:27 [Process Scan] Updating DB Info
10:38:27 [Process Scan] Sessions Events (connect / discconnect)
10:38:27 [Process Scan] Creating new devices
10:38:27 [Process Scan] Updating Devices Info
pcap_activate: eth1: No such device exists
(SIOCGIFHWADDR: No such device)
WARNING: host part of 77.40.53.253/24 is non-zero
10:38:27 [Process Scan] Resolve devices names
10:38:27 [Process Scan] Voiding false (ghost) disconnections
10:38:27 [Process Scan] Pairing session events (connection / disconnection) 
10:38:27 [Process Scan] Creating sessions snapshot
10:38:27 [Process Scan] Inserting scan results into Online_History
10:38:27 [Process Scan] Skipping repeated notifications
10:38:27 [Skip Repeated Notifications] Skip Repeated start
10:38:27 [Skip Repeated Notifications] Skip Repeated end
10:38:27 [Notification] Check if something to report
10:38:27 [Notification] Open text Template
10:38:27 [Notification] Open html Template
10:38:27 [Notification] included sections: ['internet', 'new_devices', 'down_devices', 'events']
10:38:27 [Notification] Internet sections done.
10:38:27 [Notification] New Devices sections done.
10:38:27 [Notification] Down Devices sections done.
10:38:27 [Notification] Events sections done.
10:38:27 [Notification] No changes to report
10:38:27 [Notification] Notifications changes: 0
10:38:27 [MAIN] Last action: internet_IP
10:38:27 [MAIN] cycle:
10:38:27 [MAIN] Process: Wait
10:38:32 [API] Update API starting
10:38:32 [MAIN] waiting to start next loop
10:38:38 [API] Update API starting
10:38:38 [MAIN] waiting to start next loop
10:38:43 [API] Update API starting
10:38:43 [MAIN] waiting to start next loop
10:38:48 [API] Update API starting
10:38:48 [MAIN] waiting to start next loop
10:38:53 [API] Update API starting
10:38:53 [MAIN] waiting to start next loop
10:38:59 [API] Update API starting
10:38:59 [MAIN] waiting to start next loop
10:39:04 [API] Update API starting
10:39:04 [MAIN] waiting to start next loop
10:39:09 [API] Update API starting
10:39:09 [MAIN] waiting to start next loop
10:39:14 [API] Update API starting
10:39:14 [MAIN] waiting to start next loop
10:39:20 [API] Update API starting
10:39:20 [MAIN] waiting to start next loop
10:39:25 [API] Update API starting
10:39:25 [MAIN] waiting to start next loop
10:39:30 [API] Update API starting
10:39:30 [Process Scan]  Processing scan results
10:39:30 [Process Scan] Print Stats
10:39:30 [Scan Stats]    Devices Detected.......: 0
10:39:30 [Scan Stats]        arp-scan detected..: 0
10:39:30 [Scan Stats]        Pi-hole detected...: +0
10:39:30 [Scan Stats]        New Devices........: 0
10:39:30 [Scan Stats]    Devices in this cycle..: 0
10:39:30 [Scan Stats]        Down Alerts........: 0
10:39:30 [Scan Stats]        New Down Alerts....: 0
10:39:30 [Scan Stats]        New Connections....: 0
10:39:30 [Scan Stats]        Disconnections.....: 0
10:39:30 [Scan Stats]        IP Changes.........: 0
10:39:30 [Process Scan] Stats end
10:39:30 [Process Scan] Updating DB Info
10:39:30 [Process Scan] Sessions Events (connect / discconnect)
10:39:30 [Process Scan] Creating new devices
10:39:30 [Process Scan] Updating Devices Info
10:39:30 [Process Scan] Resolve devices names
10:39:30 [Process Scan] Voiding false (ghost) disconnections
10:39:30 [Process Scan] Pairing session events (connection / disconnection) 
10:39:30 [Process Scan] Creating sessions snapshot
10:39:30 [Process Scan] Inserting scan results into Online_History
10:39:30 [Process Scan] Skipping repeated notifications
10:39:30 [Skip Repeated Notifications] Skip Repeated start
10:39:30 [Skip Repeated Notifications] Skip Repeated end
10:39:30 [MAIN] Process: Wait

Paste your pialert.conf (remove personal info)

#-----------------AUTOGENERATED FILE-----------------#
#                                                    #
#         Generated:  2023-05-11_14-40-54            #
#                                                    #
#   Config file for the LAN intruder detection app:  #
#      https://github.com/jokob-sk/Pi.Alert          #
#                                                    #
#-----------------AUTOGENERATED FILE-----------------#

# General
#---------------------------
ENABLE_ARPSCAN=True
SCAN_SUBNETS=['192.168.1.0/24 --interface=eth1','192.168.1.0/24 --interface=eth0','77.40.53.253/24 --interface=eth0']
LOG_LEVEL='verbose'
TIMEZONE='Europe/Moscow'
ENABLE_PLUGINS=True
PIALERT_WEB_PROTECTION=False
PIALERT_WEB_PASSWORD='8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
INCLUDED_SECTIONS=['internet','new_devices','down_devices','events']
SCAN_CYCLE_MINUTES=5
DAYS_TO_KEEP_EVENTS=90
REPORT_DASHBOARD_URL='***************'
DIG_GET_IP_ARG='-4 myip.opendns.com @resolver1.opendns.com'
UI_LANG='English'

# Email
#---------------------------
REPORT_MAIL=False
SMTP_SERVER='smtp.gmail.com'
SMTP_PORT=465
REPORT_TO=''
REPORT_FROM='Pi.Alert Safeguard'
SMTP_SKIP_LOGIN=True
SMTP_USER='**********'
SMTP_PASS='**********'
SMTP_SKIP_TLS=True
SMTP_FORCE_SSL=True

# Webhooks
#---------------------------
REPORT_WEBHOOK=False
WEBHOOK_URL='http://n8n.local:5555/webhook-test/aaaaaaaa-aaaa-aaaa-aaaaa-aaaaaaaaaaaa'
WEBHOOK_PAYLOAD='json'
WEBHOOK_REQUEST_METHOD='GET'

# Apprise
#---------------------------
REPORT_APPRISE=False
APPRISE_HOST='http://localhost:8000/notify'
APPRISE_URL='mailto://smtp-relay.sendinblue.com:587?from=user@gmail.com&name=apprise&user=user@gmail.com&pass=password&to=user@gmail.com'
APPRISE_PAYLOAD='html'

# NTFY
#---------------------------
REPORT_NTFY=True
NTFY_HOST='https://ntfy.sh'
NTFY_TOPIC='pi_alert_30041969'
NTFY_USER='***********'
NTFY_PASSWORD='**********'

# PUSHSAFER
#---------------------------
REPORT_PUSHSAFER=False
PUSHSAFER_TOKEN='ApiKey'

# MQTT
#---------------------------
REPORT_MQTT=True
MQTT_BROKER='192.168.1.43'
MQTT_PORT=1883
MQTT_USER='************'
MQTT_PASSWORD='***********'
MQTT_QOS=0
MQTT_DELAY_SEC=2

# DynDNS
#---------------------------
DDNS_ACTIVE=False
DDNS_DOMAIN='your_domain.freeddns.org'
DDNS_USER='dynu_user'
DDNS_PASSWORD='A0000000B0000000C0000000D0000000'
DDNS_UPDATE_URL='https://api.dynu.com/nic/update?'

# PiHole
#---------------------------
PIHOLE_ACTIVE=False
DHCP_ACTIVE=False

# Pholus
#---------------------------
PHOLUS_ACTIVE=False
PHOLUS_TIMEOUT=120
PHOLUS_FORCE=False
PHOLUS_RUN='once'
PHOLUS_RUN_TIMEOUT=600
PHOLUS_RUN_SCHD='0 4 * * *'
PHOLUS_DAYS_DATA=7

# Nmap
#---------------------------
NMAP_ACTIVE=True
NMAP_TIMEOUT=150
NMAP_RUN='none'
NMAP_RUN_SCHD='0 2 * * *'
NMAP_ARGS='-p -10000'

# API
#---------------------------
API_CUSTOM_SQL='SELECT * FROM Devices WHERE dev_PresentLastScan = 0'

# DHCPLSS
#---------------------------
DHCPLSS_RUN='disabled'
DHCPLSS_CMD='python3 /home/pi/pialert/front/plugins/dhcp_leases/script.py paths={paths}'
DHCPLSS_paths_to_check=['/mnt/dhcp1.leases','/mnt/dhcp2.leases']
DHCPLSS_RUN_SCHD='0 2 * * *'
DHCPLSS_RUN_TIMEOUT=5
DHCPLSS_WATCH=['Watched_Value1','Watched_Value4']
DHCPLSS_REPORT_ON=['new','watched-changed']

# DHCPSRVS
#---------------------------
DHCPSRVS_RUN='disabled'
DHCPSRVS_CMD='python3 /home/pi/pialert/front/plugins/dhcp_servers/script.py'
DHCPSRVS_RUN_SCHD='0 2 * * *'
DHCPSRVS_RUN_TIMEOUT=5
DHCPSRVS_WATCH=['Watched_Value1']
DHCPSRVS_REPORT_ON=['new','watched-changed']

# NMAPSRV
#---------------------------
NMAPSRV_RUN='disabled'
NMAPSRV_CMD='SELECT  ns.MAC as Object_PrimaryID, cast({s-quote}http://{s-quote} || dv.dev_LastIP as VARCHAR(100)) || {s-quote}:{s-quote} || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , {s-quote}/{s-quote})) as VARCHAR(100)) as Object_SecondaryID,  datetime() as DateTime,  ns.Service as Watched_Value1, ns.State as Watched_Value2, dv.dev_Name as Watched_Value3,        {s-quote}null{s-quote} as Watched_Value4,        ns.Extra as Extra, ns.MAC as ForeignKey FROM (SELECT * FROM Nmap_Scan) ns left JOIN (SELECT dev_Name, dev_MAC, dev_LastIP FROM Devices) dv  ON ns.MAC = dv.dev_MAC'
NMAPSRV_RUN_SCHD='0 2 * * *'
NMAPSRV_WATCH=['Watched_Value1']
NMAPSRV_REPORT_ON=['new','watched-changed']

# SNMPDSC
#---------------------------
SNMPDSC_RUN='disabled'
SNMPDSC_CMD='python3 /home/pi/pialert/front/plugins/snmp_discovery/script.py routers={s-quote}{routers}{s-quote}'
SNMPDSC_routers=['snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2']
SNMPDSC_RUN_SCHD='0 2 * * *'
SNMPDSC_RUN_TIMEOUT=5
SNMPDSC_WATCH=['Watched_Value1']
SNMPDSC_REPORT_ON=['new','watched-changed']

# UNFIMP
#---------------------------
UNFIMP_RUN='disabled'
UNFIMP_CMD='python3 /home/pi/pialert/front/plugins/unifi_import/script.py username={username} password={password}  host={host} sites={sites}  protocol={protocol} port={port} version={version}'
UNFIMP_username=''
UNFIMP_password=''
UNFIMP_protocol='https://'
UNFIMP_host='192.168.1.1'
UNFIMP_port='8443'
UNFIMP_version=''
UNFIMP_sites=['default']
UNFIMP_RUN_SCHD='0 2 * * *'
UNFIMP_RUN_TIMEOUT=5
UNFIMP_WATCH=['Watched_Value1','Watched_Value4']
UNFIMP_REPORT_ON=['new','watched-changed']

# WEBMON
#---------------------------
WEBMON_RUN='schedule'
WEBMON_CMD='python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}'
WEBMON_RUN_SCHD='30 * * * *'
WEBMON_API_SQL='SELECT * FROM plugin_website_monitor'
WEBMON_RUN_TIMEOUT=5
WEBMON_WATCH=['Watched_Value1']
WEBMON_REPORT_ON=['new','watched-changed']
WEBMON_urls_to_check=['persona12.ru']
WEBMON_SQL_internet_ip='SELECT dev_LastIP FROM Devices WHERE dev_MAC = {s-quote}Internet{s-quote}'

#-------------------IMPORTANT INFO-------------------#
#   This file is ingested by a python script, so if  #
#        modified it needs to use python syntax      #
#-------------------IMPORTANT INFO-------------------#

Paste your docker-compose.yml and .env (remove personal info)

docker-compose.yml

version: "3.9"
services:
  pi.alert:
     container_name: Pi.Alert
     healthcheck:
      test: curl -f http://localhost:17811/ || exit 1
     mem_limit: 2g
     cpu_shares: 768
     security_opt:
      - no-new-privileges:true
     volumes:
      - /volume1/docker/pialert/config:/home/pi/pialert/config:rw
      - /volume1/docker/pialert/db:/home/pi/pialert/db:rw
      - /volume1/docker/pialert/logs:/home/pi/pialert/front/log:rw
     environment:
      TZ: Europe/Moscow
      PORT: 17811
      HOST_USER_ID: 1026
      HOST_USER_GID: 100
     network_mode: host
     restart: on-failure:5
     image: jokobsk/pi.alert:latest

.env

paste_here

Screenshots If applicable, add screenshots to help explain your problem.

jokob-sk commented 1 year ago

Hi there,

Could you please make sure you are using the correct interface as described in the docs?

https://github.com/jokob-sk/Pi.Alert/blob/main/docs/SUBNETS.md

Please make sure the interface corresponds to the output of iwconfig run in the container.

According to the log, the interface didn't seem to be found:

pcap_activate: eth1: No such device exists (SIOCGIFHWADDR: No such device)

Thanks, J

YoSafeguard commented 1 year ago

Hi there!!!

I brought the network interface in accordance with the recommendations in the settings. Now this error is gone:

pcap_activate: eth1: No such device exists

But restarts continue stably every 2 hours exactly. The last one was at 9.30, before that at 7.30. After 5 restarts, the container stops. Sending the latest log:

`09:28:03 [Process Scan] Print Stats 09:28:03 [Scan Stats] Devices Detected.......: 0 09:28:03 [Scan Stats] arp-scan detected..: 0 09:28:03 [Scan Stats] Pi-hole detected...: +0 09:28:03 [Scan Stats] New Devices........: 0 09:28:03 [Scan Stats] Devices in this cycle..: 0 09:28:03 [Scan Stats] Down Alerts........: 0 09:28:03 [Scan Stats] New Down Alerts....: 0 09:28:03 [Scan Stats] New Connections....: 0 09:28:03 [Scan Stats] Disconnections.....: 0 09:28:03 [Scan Stats] IP Changes.........: 0 09:28:03 [Process Scan] Stats end 09:28:03 [Process Scan] Updating DB Info 09:28:03 [Process Scan] Sessions Events (connect / discconnect) 09:28:03 [Process Scan] Creating new devices 09:28:03 [Process Scan] Updating Devices Info 09:28:03 [Process Scan] Resolve devices names 09:28:03 [Process Scan] Voiding false (ghost) disconnections 09:28:03 [Process Scan] Pairing session events (connection / disconnection) 09:28:03 [Process Scan] Creating sessions snapshot 09:28:03 [Process Scan] Inserting scan results into Online_History 09:28:03 [Process Scan] Skipping repeated notifications 09:28:03 [Skip Repeated Notifications] Skip Repeated start 09:28:03 [Skip Repeated Notifications] Skip Repeated end 09:28:03 [MAIN] Process: Wait 09:28:08 [API] Update API starting 09:28:09 [MAIN] waiting to start next loop 09:28:14 [API] Update API starting 09:28:14 [MAIN] waiting to start next loop 09:28:19 [API] Update API starting 09:28:19 [MAIN] waiting to start next loop 09:28:24 [API] Update API starting 09:28:24 [MAIN] waiting to start next loop 09:28:29 [API] Update API starting 09:28:30 [MAIN] waiting to start next loop 09:28:35 [API] Update API starting 09:28:35 [MAIN] waiting to start next loop 09:28:40 [API] Update API starting 09:28:40 [MAIN] waiting to start next loop 09:28:45 [API] Update API starting 09:28:45 [MAIN] waiting to start next loop 09:28:50 [API] Update API starting 09:28:50 [MAIN] waiting to start next loop 09:28:56 [API] Update API starting 09:28:56 [MAIN] waiting to start next loop 09:29:01 [API] Update API starting 09:29:01 [MAIN] waiting to start next loop 09:29:06 [API] Update API starting 09:29:06 [Internet IP] Check Internet IP started 09:29:06 [Internet IP] - Retrieving Internet IP 09:29:06 [Internet IP] IP: 0.0.0.0 09:29:06 [Internet IP] Retrieving previous IP: 09:29:06 [Internet IP] 0.0.0.0 09:29:06 [Internet IP] No changes to perform 09:29:06 [DDNS] Skipping Dynamic DNS update 09:29:06 [Process Scan] Processing scan results 09:29:07 [Process Scan] Print Stats 09:29:07 [Scan Stats] Devices Detected.......: 0 09:29:07 [Scan Stats] arp-scan detected..: 0 09:29:07 [Scan Stats] Pi-hole detected...: +0 09:29:07 [Scan Stats] New Devices........: 0 09:29:07 [Scan Stats] Devices in this cycle..: 0 09:29:07 [Scan Stats] Down Alerts........: 0 09:29:07 [Scan Stats] New Down Alerts....: 0 09:29:07 [Scan Stats] New Connections....: 0 09:29:07 [Scan Stats] Disconnections.....: 0 09:29:07 [Scan Stats] IP Changes.........: 0 09:29:07 [Process Scan] Stats end 09:29:07 [Process Scan] Updating DB Info 09:29:07 [Process Scan] Sessions Events (connect / discconnect) 09:29:07 [Process Scan] Creating new devices 09:29:07 [Process Scan] Updating Devices Info 09:29:07 [Process Scan] Resolve devices names 09:29:07 [Process Scan] Voiding false (ghost) disconnections 09:29:07 [Process Scan] Pairing session events (connection / disconnection) 09:29:07 [Process Scan] Creating sessions snapshot 09:29:07 [Process Scan] Inserting scan results into Online_History 09:29:07 [Process Scan] Skipping repeated notifications 09:29:07 [Skip Repeated Notifications] Skip Repeated start 09:29:07 [Skip Repeated Notifications] Skip Repeated end 09:29:07 [Notification] Check if something to report 09:29:07 [Notification] Open text Template 09:29:07 [Notification] Open html Template 09:29:07 [Notification] included sections: ['internet', 'new_devices', 'down_devices', 'events'] 09:29:07 [Notification] Internet sections done. 09:29:07 [Notification] New Devices sections done. 09:29:07 [Notification] Down Devices sections done. 09:29:07 [Notification] Events sections done. 09:29:07 [Notification] No changes to report 09:29:07 [Notification] Notifications changes: 0 09:29:07 [MAIN] Last action: internet_IP 09:29:07 [MAIN] cycle: 09:29:07 [MAIN] Process: Wait 09:29:12 [API] Update API starting 09:29:12 [MAIN] waiting to start next loop 09:29:17 [API] Update API starting 09:29:17 [MAIN] waiting to start next loop 09:29:23 [API] Update API starting 09:29:23 [MAIN] waiting to start next loop 09:29:28 [API] Update API starting 09:29:28 [MAIN] waiting to start next loop 09:29:33 [API] Update API starting 09:29:33 [MAIN] waiting to start next loop 09:29:38 [API] Update API starting 09:29:38 [MAIN] waiting to start next loop 09:29:44 [API] Update API starting 09:29:44 [MAIN] waiting to start next loop 09:29:49 [API] Update API starting 09:29:49 [MAIN] waiting to start next loop 09:29:54 [API] Update API starting 09:29:54 [MAIN] waiting to start next loop 09:29:59 [API] Update API starting 09:29:59 [MAIN] waiting to start next loop 09:30:05 [API] Update API starting 09:30:05 [MAIN] waiting to start next loop 09:30:10 [API] Update API starting 09:30:11

09:30:11 Permissions check (All should be True) 09:30:11 ------------------------------------------------ 09:30:11 /config/pialert.conf | READ | True 09:30:11 /config/pialert.conf | WRITE | True 09:30:11 /db/pialert.db | READ | True 09:30:11 /db/pialert.db | WRITE | True 09:30:11 ------------------------------------------------ 09:30:11 [Setup] Attempting to fix permissions. 09:30:11 [Setup] Attempting to fix permissions. 09:30:11 [Database] Opening DB 09:30:11 [upgradeDB] Re-creating Settings table 09:30:11 [upgradeDB] Re-creating Parameters table 09:30:11 [Config] reading config file 09:30:11 [Config] Plugins: Number of dynamically loaded plugins: 7 09:30:11 [Plugins] --------------------------------------------- 09:30:11 [Plugins] display_name: DHCP Leases 09:30:11 [Plugins] description: This plugin is to import devices from dhcp.leases files. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Rogue DHCP 09:30:12 [Plugins] description: This plugin is to use NMAP to monitor for rogue DHCP servers. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Services (NMAP) 09:30:12 [Plugins] description: This plugin shows all services discovered by NMAP scans. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: SNMP discovery 09:30:12 [Plugins] description: This plugin is used to discover devices via the arp table(s) of a RFC1213 compliant router or switch. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: Un-Discoverable Devices 09:30:12 [Plugins] description: This plugin is to import undiscoverable devices from a file. 09:30:12 [Plugins] --------------------------------------------- 09:30:12 [Plugins] display_name: UniFi import 09:30:12 [Plugins] description: This plugin is used to import devices from an UNIFI controller. 09:30:13 [Plugins] --------------------------------------------- 09:30:13 [Plugins] display_name: Website monitor 09:30:13 [Plugins] description: This plugin is to monitor status changes of services or websites. 09:30:14 [API] Update API starting 09:30:14 [API] Updating table_settings.json file in /front/api 09:30:14 [Config] Imported new config 09:30:14 [API] Update API starting 09:30:14 [API] Updating table_devices.json file in /front/api 09:30:14 [API] Updating table_nmap_scan.json file in /front/api 09:30:14 [API] Updating table_pholus_scan.json file in /front/api 09:30:14 [API] Updating table_events_pending_alert.json file in /front/api 09:30:14 [API] Updating table_plugins_events.json file in /front/api 09:30:14 [API] Updating table_plugins_history.json file in /front/api 09:30:14 [API] Updating table_plugins_objects.json file in /front/api 09:30:14 [API] Updating table_language_strings.json file in /front/api 09:30:14 [API] Updating table_custom_endpoint.json file in /front/api 09:30:14 [Internet IP] Check Internet IP started 09:30:14 [Internet IP] - Retrieving Internet IP 09:30:15 [Internet IP] IP: 0.0.0.0 09:30:15 [Internet IP] Retrieving previous IP: 09:30:15 [Internet IP] 0.0.0.0 09:30:15 [Internet IP] No changes to perform 09:30:15 [DDNS] Skipping Dynamic DNS update 09:30:15 [PholusScan] Scan: Pholus for 600s (10.0min) 09:30:15 [PholusScan] Pholus scan on [interface] eth0 [mask] 192.168.1.0/24 09:30:53 [PholusScan] Scan: Pholus SUCCESS 09:31:08 [MAIN] cycle:1 09:31:08 [Network Scan] Scan Devices: 09:31:08 [Network Scan] arp-scan start 09:31:19 [Network Scan] arp-scan ends 09:31:19 [Process Scan] Processing scan results 09:31:20 [Process Scan] Print Stats 09:31:20 [Scan Stats] Devices Detected.......: 23 09:31:20 [Scan Stats] arp-scan detected..: 21 09:31:20 [Scan Stats] Pi-hole detected...: +0 09:31:20 [Scan Stats] New Devices........: 0 09:31:20 [Scan Stats] Devices in this cycle..: 23 09:31:20 [Scan Stats] Down Alerts........: 13 09:31:20 [Scan Stats] New Down Alerts....: 1 09:31:20 [Scan Stats] New Connections....: 0 09:31:20 [Scan Stats] Disconnections.....: 2 09:31:20 [Scan Stats] IP Changes.........: 0 09:31:20 [Process Scan] Stats end 09:31:20 [Process Scan] Updating DB Info 09:31:20 [Process Scan] Sessions Events (connect / discconnect) 09:31:20 [Process Scan] Creating new devices 09:31:20 [Process Scan] Updating Devices Info 09:31:20 [Process Scan] Resolve devices names 09:31:20 [Process Scan] Voiding false (ghost) disconnections 09:31:20 [Process Scan] Pairing session events (connection / disconnection) 09:31:20 [Process Scan] Creating sessions snapshot 09:31:20 [Process Scan] Inserting scan results into Online_History 09:31:20 [Process Scan] Skipping repeated notifications 09:31:20 [Skip Repeated Notifications] Skip Repeated start 09:31:20 [Skip Repeated Notifications] Skip Repeated end 09:31:20 [Notification] Check if something to report 09:31:20 [Notification] Open text Template 09:31:20 [Notification] Open html Template 09:31:20 [Notification] included sections: ['internet', 'new_devices', 'downdevices', 'events'] 09:31:20 [Notification] Internet sections done. 09:31:20 [Notification] New Devices sections done. 09:31:20 [Notification] Down Devices sections done. 09:31:20 [Notification] Events sections done. 09:31:20 [Notification] Changes detected, sending reports 09:31:20 [Notification] Udateing API files 09:31:20 [Send API] Updating notification* files in /home/pi/pialert/front/api/ 09:31:20 [Notification] Skip email 09:31:20 [Notification] Skip Apprise 09:31:20 [Notification] Skip webhook 09:31:20 [Notification] Sending report by NTFY 09:31:21 [Notification] Skip PUSHSAFER 09:31:21 [Notification] Establishing MQTT thread 09:31:21 Connected to broker 09:31:33 Estimated delay: 450s (7.5min) 09:39:03 [Notification] Notifications changes: 0 09:39:03 [MAIN] cycle:cleanup 09:39:03 [DB Cleanup] Upkeep Database: 09:39:03 [DB Cleanup] Online_History: Delete all but keep latest 150 entries 09:39:03 [DB Cleanup] Optimize Database 09:39:03 [DB Cleanup] Events: Delete all older than 90 days 09:39:03 [DB Cleanup] Plugin Events History: Delete all older than 90 days 09:39:03 [DB Cleanup] Pholus_Scan: Delete all older than 7 days 09:39:03 [DB Cleanup] Pholus_Scan: Delete all duplicates 09:39:03 Nmap_Scan: Delete all duplicates 09:39:03 Shrink Database 09:39:04 [MAIN] Last action: cleanup 09:39:04 [MAIN] cycle: 09:39:04 [MAIN] Process: Wait 09:39:09 [API] Update API starting 09:39:09 [API] Updating table_devices.json file in /front/api 09:39:09 [API] Updating table_pholus_scan.json file in /front/api 09:39:09 [API] Updating table_custom_endpoint.json file in /front/api 09:39:09 [Internet IP] Check Internet IP started 09:39:09 [Internet IP] - Retrieving Internet IP 09:39:09 [Internet IP] IP: 0.0.0.0 09:39:09 [Internet IP] Retrieving previous IP: 09:39:09 [Internet IP] 0.0.0.0 09:39:09 [Internet IP] No changes to perform 09:39:09 [DDNS] Skipping Dynamic DNS update 09:39:09 [MAIN] cycle:1 09:39:09 [Network Scan] Scan Devices: 09:39:09 [Network Scan] arp-scan start 09:39:20 [Network Scan] arp-scan ends 09:39:20 [Process Scan] Processing scan results 09:39:21 [Process Scan] Print Stats 09:39:21 [Scan Stats] Devices Detected.......: 23 09:39:21 [Scan Stats] arp-scan detected..: 21 09:39:21 [Scan Stats] Pi-hole detected...: +0 09:39:21 [Scan Stats] New Devices........: 0 09:39:21 [Scan Stats] Devices in this cycle..: 23 09:39:21 [Scan Stats] Down Alerts........: 13 09:39:21 [Scan Stats] New Down Alerts....: 0 09:39:21 [Scan Stats] New Connections....: 0 09:39:21 [Scan Stats] Disconnections.....: 0 09:39:21 [Scan Stats] IP Changes.........: 0 09:39:21 [Process Scan] Stats end`

Data-Monkey commented 1 year ago

might be related to this error:

10:28:28 [Process Scan] Resolve devices names
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pi/pialert/pialert/__main__.py", line 314, in <module>
    sys.exit(main())       
  File "/home/pi/pialert/pialert/__main__.py", line 163, in main
    run_plugin_scripts(db,'schedule') 
  File "/home/pi/pialert/pialert/plugin.py", line 38, in run_plugin_scripts
    shouldRun = schd.runScheduleCheck()  
  File "/home/pi/pialert/pialert/scheduler.py", line 30, in runScheduleCheck
    if nowTime > self.last_next_schedule and self.last_run < self.last_next_schedule:
TypeError: can't compare offset-naive and offset-aware datetimes
YoSafeguard commented 1 year ago

Hello! This is the only error I find in the first log file. It is missing in the second log. And I can't understand her

YoSafeguard commented 1 year ago

Found the reason for restarts. This is Website Monitor. Disabled it and restarts every 2 hours stopped. Thank you!

Data-Monkey commented 1 year ago

Do you have any other plugins scheduled? I would expect all schedules to result in the same error.

jokob-sk commented 1 year ago

Hey,

Thanks for the ongoing reporting and testing!

The schedule error is odd, because your schedule is set to be executed once an hour not once every 2 hours. Maybe the error is a fluke (it never is though, is it haha). Here is your schedule for webmon according to your config:

# WEBMON
#---------------------------
WEBMON_RUN='schedule'
WEBMON_CMD='python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls={urls}'
WEBMON_RUN_SCHD='30 * * * *'

So the error/restart should appear every hour on the 30th minute.

Another odd thing - it seems like it's happening during API update - that could point to a permissions issue, e.g. another process changing permissions every ~2h on the folder that is used to output the APIs.

Oh...another thing - what about the health check in your docker compose, could you please try to disable it:

     restart: on-failure:5

because you've set to restart the container if unresponsive (maybe I misunderstand - I don't use health check myself):


version: "3.9"
services:
  pi.alert:
     container_name: Pi.Alert
     healthcheck:
      test: curl -f http://localhost:17811/ || exit 1
     mem_limit: 2g
     cpu_shares: 768
     security_opt:
      - no-new-privileges:true
     volumes:
      - /volume1/docker/pialert/config:/home/pi/pialert/config:rw
      - /volume1/docker/pialert/db:/home/pi/pialert/db:rw
      - /volume1/docker/pialert/logs:/home/pi/pialert/front/log:rw
     environment:
      TZ: Europe/Moscow
      PORT: 17811
      HOST_USER_ID: 1026
      HOST_USER_GID: 100
     network_mode: host
     restart: on-failure:5
     image: jokobsk/pi.alert:latest
jokob-sk commented 1 year ago

no reply for a week > closing for now