mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
MQTT rework v0.4, install scripts rework, Traefik docs 📦
This commit is contained in:
0
pialert/appevent.py
Normal file → Executable file
0
pialert/appevent.py
Normal file → Executable file
@@ -14,8 +14,8 @@ logPath = pialertPath + '/front/log'
|
||||
apiPath = pialertPath + '/front/api/'
|
||||
fullConfPath = pialertPath + confPath
|
||||
fullDbPath = pialertPath + dbPath
|
||||
vendorsPath6 = '/usr/share/arp-scan/ieee-oui.txt'
|
||||
vendorsPath9 = '/usr/share/arp-scan/ieee-iab.txt'
|
||||
vendorsPath = '/usr/share/arp-scan/ieee-oui.txt'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import conf
|
||||
import re
|
||||
from helper import timeNowTZ, get_setting, get_setting_value,resolve_device_name_dig, resolve_device_name_pholus, check_IP_format
|
||||
from logger import mylog, print_log
|
||||
from const import vendorsPath6, vendorsPath9
|
||||
from const import vendorsPath
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -343,19 +343,13 @@ def query_MAC_vendor (pMAC):
|
||||
mac_start_string9 = mac[0:9]
|
||||
|
||||
try:
|
||||
with open(vendorsPath6, 'r') as f:
|
||||
with open(vendorsPath, 'r') as f:
|
||||
for line in f:
|
||||
if line.startswith(mac_start_string6):
|
||||
vendor = line.split(' ', 1)[1].strip()
|
||||
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath6}"])
|
||||
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath}"])
|
||||
return vendor
|
||||
|
||||
with open(vendorsPath9, 'r') as f:
|
||||
for line in f:
|
||||
if line.startswith(mac_start_string9):
|
||||
vendor = line.split(' ', 1)[1].strip()
|
||||
mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath9}"])
|
||||
return vendor
|
||||
|
||||
return -1 # MAC address not found in the database
|
||||
except FileNotFoundError:
|
||||
|
||||
@@ -65,7 +65,7 @@ def process_scan (db):
|
||||
skip_repeated_notifications (db)
|
||||
|
||||
# Clear current scan as processed
|
||||
db.sql.execute ("DELETE FROM CurrentScan")
|
||||
db.sql.execute ("DELETE FROM CurrentScan")
|
||||
|
||||
# Commit changes
|
||||
db.commitDB()
|
||||
|
||||
0
pialert/notification.py
Normal file → Executable file
0
pialert/notification.py
Normal file → Executable file
@@ -3,7 +3,7 @@ import json
|
||||
|
||||
import conf
|
||||
from logger import mylog
|
||||
from const import pluginsPath, logPath
|
||||
from const import pluginsPath, logPath, apiPath
|
||||
from helper import timeNowTZ, updateState, get_file_content, write_file, get_setting, get_setting_value
|
||||
|
||||
module_name = 'Plugin utils'
|
||||
|
||||
Reference in New Issue
Block a user