FQDN incorrect check #1081, vendor work #1080

This commit is contained in:
jokob-sk
2025-06-11 07:26:52 +10:00
parent dff63b74f5
commit 69cf4057ac
10 changed files with 41 additions and 12 deletions

0
.github/FUNDING.yml vendored Normal file → Executable file
View File

View File

@@ -66,7 +66,8 @@ services:
- ${DEV_LOCATION}/front/appEvents.php:/app/front/appEvents.php - ${DEV_LOCATION}/front/appEvents.php:/app/front/appEvents.php
- ${DEV_LOCATION}/front/appEventsCore.php:/app/front/appEventsCore.php - ${DEV_LOCATION}/front/appEventsCore.php:/app/front/appEventsCore.php
- ${DEV_LOCATION}/front/multiEditCore.php:/app/front/multiEditCore.php - ${DEV_LOCATION}/front/multiEditCore.php:/app/front/multiEditCore.php
- ${DEV_LOCATION}/front/plugins:/app/front/plugins - ${DEV_LOCATION}/front/plugins:/app/front/plugins
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes # DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
environment: environment:

View File

@@ -49,6 +49,8 @@ query GetDevices($options: PageQueryOptionsInput) {
} }
``` ```
See also: [Debugging GraphQL issues](./DEBUG_GRAPHQL.md)
### `curl` Command ### `curl` Command
You can use the following `curl` command to execute the query. You can use the following `curl` command to execute the query.

View File

@@ -2,6 +2,7 @@
Use the official installation guides at first and use community content as supplementary material. Open an issue or PR if you'd like to add your link to the list 🙏 (Ordered by last update time) Use the official installation guides at first and use community content as supplementary material. Open an issue or PR if you'd like to add your link to the list 🙏 (Ordered by last update time)
- ▶ [Discover & Monitor Your Network with This Self-Hosted Open Source Tool - Lawrence Systems](https://www.youtube.com/watch?v=R3b5cxLZMpo) (June 2025)
- ▶ [Home Lab Network Monitoring - Scotti-BYTE Enterprise Consulting Services](https://www.youtube.com/watch?v=0DryhzrQSJA) (July 2024) - ▶ [Home Lab Network Monitoring - Scotti-BYTE Enterprise Consulting Services](https://www.youtube.com/watch?v=0DryhzrQSJA) (July 2024)
- 📄 [How to Install NetAlertX on Your Synology NAS - Marius hosting](https://mariushosting.com/how-to-install-pi-alert-on-your-synology-nas/) (Updated frequently) - 📄 [How to Install NetAlertX on Your Synology NAS - Marius hosting](https://mariushosting.com/how-to-install-pi-alert-on-your-synology-nas/) (Updated frequently)
- 📄 [Using the PiAlert Network Security Scanner on a Raspberry Pi - PiMyLifeUp](https://pimylifeup.com/raspberry-pi-pialert/) - 📄 [Using the PiAlert Network Security Scanner on a Raspberry Pi - PiMyLifeUp](https://pimylifeup.com/raspberry-pi-pialert/)

View File

@@ -58,9 +58,9 @@ def main():
# Retrieve devices # Retrieve devices
if get_setting_value("REFRESH_FQDN"): if get_setting_value("REFRESH_FQDN"):
devices = device_handler.getUnknown()
else:
devices = device_handler.getAll() devices = device_handler.getAll()
else:
devices = device_handler.getUnknown()
mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}']) mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}'])

View File

@@ -56,9 +56,9 @@ def main():
# Retrieve devices # Retrieve devices
if get_setting_value("REFRESH_FQDN"): if get_setting_value("REFRESH_FQDN"):
devices = device_handler.getUnknown()
else:
devices = device_handler.getAll() devices = device_handler.getAll()
else:
devices = device_handler.getUnknown()
mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}']) mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}'])

View File

@@ -58,9 +58,9 @@ def main():
# Retrieve devices # Retrieve devices
if get_setting_value("REFRESH_FQDN"): if get_setting_value("REFRESH_FQDN"):
devices = device_handler.getUnknown()
else:
devices = device_handler.getAll() devices = device_handler.getAll()
else:
devices = device_handler.getUnknown()
mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}']) mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}'])

View File

@@ -60,9 +60,9 @@ def main():
# Retrieve devices # Retrieve devices
if get_setting_value("REFRESH_FQDN"): if get_setting_value("REFRESH_FQDN"):
devices = device_handler.getUnknown()
else:
devices = device_handler.getAll() devices = device_handler.getAll()
else:
devices = device_handler.getUnknown()
mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}']) mylog('verbose', [f'[{pluginName}] Devices count: {len(devices)}'])

View File

@@ -52,7 +52,7 @@ def main():
# init global variables # init global variables
global UNIFI_USERNAME, UNIFI_PASSWORD, UNIFI_HOST, UNIFI_SITES, PORT, VERIFYSSL, VERSION, FULL_IMPORT global UNIFI_USERNAME, UNIFI_PASSWORD, UNIFI_HOST, UNIFI_SITES, PORT, VERIFYSSL, VERSION, FULL_IMPORT, API_KEY
# parse output # parse output
plugin_objects = Plugin_Objects(RESULT_FILE) plugin_objects = Plugin_Objects(RESULT_FILE)
@@ -65,6 +65,10 @@ def main():
VERIFYSSL = get_setting_value("UNFIMP_verifyssl") VERIFYSSL = get_setting_value("UNFIMP_verifyssl")
VERSION = get_setting_value("UNFIMP_version") VERSION = get_setting_value("UNFIMP_version")
FULL_IMPORT = get_setting_value("UNFIMP_fullimport") FULL_IMPORT = get_setting_value("UNFIMP_fullimport")
API_KEY = get_setting_value("UNFIMP_api_key")
if API_KEY == '':
API_KEY = None
plugin_objects = get_entries(plugin_objects) plugin_objects = get_entries(plugin_objects)
@@ -96,7 +100,28 @@ def get_entries(plugin_objects: Plugin_Objects) -> Plugin_Objects:
mylog('verbose', [f'[{pluginName}] site: {site}']) mylog('verbose', [f'[{pluginName}] site: {site}'])
c = Controller(UNIFI_HOST, UNIFI_USERNAME, UNIFI_PASSWORD, port=PORT, version=VERSION, ssl_verify=VERIFYSSL, site_id=site)
# def __init__(
# self,
# host,
# username=None,
# password=None,
# port=8443,
# version="v5",
# site_id="default",
# ssl_verify=True,
# api_key=None
# ):
c = Controller(
UNIFI_HOST,
UNIFI_USERNAME,
UNIFI_PASSWORD,
port=PORT,
version=VERSION,
ssl_verify=VERIFYSSL,
site_id=site,
api_key=API_KEY)
online_macs = set() online_macs = set()
processed_macs = [] processed_macs = []

View File

@@ -19,7 +19,7 @@ from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmp
from logger import mylog, Logger, append_line_to_file from logger import mylog, Logger, append_line_to_file
from helper import timeNowTZ, get_setting_value from helper import timeNowTZ, get_setting_value
from const import logPath, applicationPath, fullDbPath from const import logPath, applicationPath, fullDbPath
from device import query_MAC_vendor from scan.device_handling import query_MAC_vendor
import conf import conf
from pytz import timezone from pytz import timezone