mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
📚 docs + guess_icon logging
This commit is contained in:
@@ -76,3 +76,16 @@ In the above output notice the section logging how many events are produced by t
|
|||||||
These values, if formatted correctly, will also show up in the UI:
|
These values, if formatted correctly, will also show up in the UI:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Sharing application state
|
||||||
|
|
||||||
|
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
||||||
|
|
||||||
|
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
||||||
|
2. Wait for the issue to occur.
|
||||||
|
3. Search for `================ DEVICES table content ================` in your logs.
|
||||||
|
4. Search for `================ CurrentScan table content ================` in your logs.
|
||||||
|
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
|
||||||
|
6. Please set `LOG_LEVEL` to `debug` or lower.
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ services:
|
|||||||
# Other service configurations...
|
# Other service configurations...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 5. Sharing application state
|
||||||
|
|
||||||
|
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
||||||
|
|
||||||
|
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
||||||
|
2. Wait for the issue to occur.
|
||||||
|
3. Search for `================ DEVICES table content ================` in your logs.
|
||||||
|
4. Search for `================ CurrentScan table content ================` in your logs.
|
||||||
|
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
|
||||||
|
6. Please set `LOG_LEVEL` to `debug` or lower.
|
||||||
|
|
||||||
## 📃Common issues
|
## 📃Common issues
|
||||||
|
|
||||||
### Permissions
|
### Permissions
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ def update_devices_data_from_scan (db):
|
|||||||
default_icon = get_setting_value('NEWDEV_dev_Icon')
|
default_icon = get_setting_value('NEWDEV_dev_Icon')
|
||||||
|
|
||||||
for device in sql.execute (query) :
|
for device in sql.execute (query) :
|
||||||
# Conditional logic for dev_Icon guessing
|
# Conditional logic for dev_Icon guessing
|
||||||
dev_Icon = guess_icon(device['dev_Vendor'], device['dev_MAC'], device['dev_LastIP'], device['dev_Name'], default_icon)
|
dev_Icon = guess_icon(device['dev_Vendor'], device['dev_MAC'], device['dev_LastIP'], device['dev_Name'], default_icon)
|
||||||
|
|
||||||
recordsToUpdate.append ([dev_Icon, device['dev_MAC']])
|
recordsToUpdate.append ([dev_Icon, device['dev_MAC']])
|
||||||
@@ -677,7 +677,10 @@ icons = {
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Guess device icon
|
# Guess device icon
|
||||||
def guess_icon(vendor, mac, ip, name, default):
|
def guess_icon(vendor, mac, ip, name, default):
|
||||||
|
|
||||||
|
mylog('debug', [f"[guess_icon] Guessing icon for (vendor|mac|ip|name): ('{vendor}'|'{mac}'|{ip}|{name})"])
|
||||||
|
|
||||||
result = default
|
result = default
|
||||||
mac = mac.upper()
|
mac = mac.upper()
|
||||||
vendor = vendor.lower() if vendor else "unknown"
|
vendor = vendor.lower() if vendor else "unknown"
|
||||||
@@ -706,7 +709,7 @@ def guess_icon(vendor, mac, ip, name, default):
|
|||||||
result = icons.get("microchip")
|
result = icons.get("microchip")
|
||||||
|
|
||||||
# Guess icon based on MAC address patterns
|
# Guess icon based on MAC address patterns
|
||||||
elif mac == "INTERNET": # Apple
|
elif mac == "INTERNET":
|
||||||
result = icons.get("globe")
|
result = icons.get("globe")
|
||||||
elif mac.startswith("00:1A:79"): # Apple
|
elif mac.startswith("00:1A:79"): # Apple
|
||||||
result = icons.get("apple")
|
result = icons.get("apple")
|
||||||
|
|||||||
Reference in New Issue
Block a user