added Logs in maintenance + cleanup

This commit is contained in:
Jokob-sk
2022-12-11 13:35:41 +11:00
parent eff474df1c
commit 6ebd4ed15b
25 changed files with 849 additions and 1488 deletions

10
front/log/IP_changes.log Executable file
View File

@@ -0,0 +1,10 @@
#-------------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# IP_changes.log - Back module. Logfile for Internet IP changes
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#-------------------------------------------------------------------------------
2021-01-01 00:00:00 0.0.0.0

441
front/log/pialert.log Executable file
View File

@@ -0,0 +1,441 @@
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:09:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:09:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....: 25
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 27
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 1
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
No changes to report...
Notifications: 0
Cleanup Database
Timestamp: 2022-12-11 13:09:00
Cleanup Online_History...
Optimize Database...
Cleanup Events, up to the lastest 90 days...
Shrink Database...
Finished cycle: cleanup
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:13:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:15:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 26
arp-scan Method....: 24
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 26
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 1
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
Changes detected, sending reports...
Sending report by email...
Sending report by Apprise...
Sending report by webhook...
Sending report by NTFY...
Skip PUSHSAFER...
Establishing MQTT thread...
Connected to broker
Notifications: 1
Finished cycle: 1
Loop end
---------------------------
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:24:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:24:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 26
arp-scan Method....: 24
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 26
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 0
Disconnections.....: 0
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: 1
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:27:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:29:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....: 25
Pi-hole Method.....: +0
New Devices........: 0
Devices in this cycle..: 27
Down Alerts........: 0
New Down Alerts....: 0
New Connections....: 1
Disconnections.....: 0
IP Changes.........: 0
Updating DB Info...
Sessions Events (connect / discconnect) ...
Creating new devices...
Updating Devices Info...
Trying to resolve devices without name...
Names updated: 0
Voiding false (ghost) disconnections...
Pairing session events (connection / disconnection) ...
Creating sessions snapshot...
Skipping repeated notifications...
Check if something to report...
Changes detected, sending reports...
Sending report by email...
Sending report by Apprise...
Sending report by webhook...
Sending report by NTFY...
Skip PUSHSAFER...
Establishing MQTT thread...
Notifications: 1
Finished cycle: 1
Loop end
---------------------------
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:30:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Check Internet IP
Timestamp: 2022-12-11 13:33:00
Retrieving Internet IP...
103.210.27.85
Retrieving previous IP...
103.210.27.85
No changes to perform
Skipping Dynamic DNS update...
Check if something to report...
No changes to report...
Notifications: 0
Finished cycle: internet_IP
Loop end
---------------------------
Wait 20s
Wait 20s
Loop start
---------------------------
Scan Devices
ScanCycle: 1
Timestamp: 2022-12-11 13:34:00
Scanning...
arp-scan Method...
arp-scan: Multiple interfaces
Pi-hole Method...
DHCP Leases Method...
Processing scan results...
Devices Detected.......: 27
arp-scan Method....:

56
front/log/report_output.html Executable file
View File

@@ -0,0 +1,56 @@
<!-- ---------------------------------------------------------------------------
# Pi.Alert
# Open Source Network Guard / WIFI & LAN intrusion detector
#
# repot_template.html - Back module. Template to email reporting in HTML format
#-------------------------------------------------------------------------------
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3
#--------------------------------------------------------------------------- -->
<html>
<head>
</head>
<body>
<font face=sans-serif>
<table align=center width=80% border=1 bordercolor=#909090 cellpadding=0 cellspacing=0 style="border-collapse: collapse; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.5)">
<tr>
<td bgcolor=#EFB956 align=center style="padding: 20px 10px 10px 10px; font-size: 36px; font-weight: bold; color:#7F6000; text-shadow: 4px 4px 6px #909090">
Pi.Alert Report
</td>
</tr>
<tr>
<td>
<table width=100% border=0 bgcolor=#FFD966 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 16px; text-align:center; color:#5F5000">
<tr>
<td width=33%> Report Date: <b>2021-01-01 08:00</b> </td>
<td width=34%> Scan Cycle: <b>1</b> </td>
<td width=33%> Server: <b>pi4</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=#F5F5F5 height=200 valign=top style="padding: 10px">
</td>
</tr>
<tr>
<td>
<table width=100% border=0 bgcolor=#70AD47 cellpadding=5px cellspacing=0 style="border-collapse: collapse; font-size: 12px; font-weight: bold; color:#385723">
<tr>
<td width=25% style="text-align:Left"> Puche 2021</td>
<td width=50% style="text-align:center"> Pi.Alert 2.50 &nbsp; / &nbsp; 2021-01-01 </td>
<td width=25% style="text-align:right"> GNU GPLv3</td>
</tr>
</table>
</td>
</tr>
</table>
</font>
</body>
</html>

15
front/log/report_output.txt Executable file
View File

@@ -0,0 +1,15 @@
========================================
Pi.Alert Report
========================================
Report Date: 2021-01-01 08:00
Scan Cycle: 1
Server: pi4
Events
----------------------------------------------------------------------
----------------------------------------------------------------------
Puche 2021 Pi.Alert 2.50 / 2021-01-01 GNU GPLv3

0
front/log/stderr.log Executable file
View File

49
front/log/stdout.log Executable file
View File

@@ -0,0 +1,49 @@
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3266 0 0 100 3266 0 2717 0:00:01 0:00:01 --:--:-- 2719
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
100 3287 100 21 100 3266 11 1769 0:00:01 0:00:01 --:--:-- 1780
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sat, 10 Dec 2022 23:41:47 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sat, 10 Dec 2022 23:41:47 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 594 100 34 100 560 400 6588 --:--:-- --:--:-- --:--:-- 7071
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 34
ETag: W/"22-6OS7cK0FzqnV2NeDHdOSGS1bVUs"
Vary: Accept-Encoding
Date: Sat, 10 Dec 2022 23:41:47 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"message":"Workflow was started"} % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3263 0 0 100 3263 0 2714 0:00:01 0:00:01 --:--:-- 2716
100 3284 100 21 100 3263 11 1859 0:00:01 0:00:01 --:--:-- 1871
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Sun, 11 Dec 2022 00:52:29 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 21
Connection: keep-alive
Expires: Sun, 11 Dec 2022 00:52:29 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate, private
Notification(s) sent. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

1
front/log/webhook_payload.json Executable file
View File

@@ -0,0 +1 @@
{"username": "Pi.Alert", "text": "There are new notifications", "attachments": [{"title": "Pi.Alert Notifications", "title_link": "http://100.89.112.105:20211", "text": {"internet": [], "new_devices": [], "down_devices": [], "events": [["94:b5:55:c7:cb:e0", "192.168.1.151", "2022-12-11 11:52:00", "Connected", "", 1, null, "94:b5:55:c7:cb:e0", "ESP32 - ttgo", "House", "", "Espressif Inc.", 0, "", "", "2022-10-16 16:55:00", "2022-12-11 11:52:00", "192.168.1.151", 0, 1, 1, 1, 0, 0, "2022-12-11 10:41:48.466369", 1, 0, "", 0, "d0:21:f9:8c:59:f9", ""]]}}]}