achnged AVAHISCAN defaults #847

This commit is contained in:
jokob-sk
2025-06-14 11:57:37 +10:00
parent b797713b2d
commit 7a2c4942bf
7 changed files with 12 additions and 28 deletions

View File

@@ -20,7 +20,7 @@
DISCOVER_PLUGINS=True DISCOVER_PLUGINS=True
SCAN_SUBNETS=['--localnet'] SCAN_SUBNETS=['--localnet']
TIMEZONE='Europe/Berlin' TIMEZONE='Europe/Berlin'
LOADED_PLUGINS=['ARPSCAN','CSVBCKP','DBCLNP', 'DIGSCAN', 'INTRNT','MAINT','NEWDEV', 'NBTSCAN', 'NSLOOKUP','NTFPRCS', 'AVAHISCAN', 'SETPWD','SMTP', 'SYNC', 'VNDRPDT', 'WORKFLOWS', 'UI'] LOADED_PLUGINS=['ARPSCAN', 'AVAHISCAN', 'CSVBCKP','DBCLNP', 'DIGSCAN', 'INTRNT', 'MAINT', 'NEWDEV', 'NBTSCAN', 'NSLOOKUP','NTFPRCS', 'SETPWD', 'SMTP', 'SYNC', 'VNDRPDT', 'WORKFLOWS', 'UI']
DAYS_TO_KEEP_EVENTS=90 DAYS_TO_KEEP_EVENTS=90
# Used for generating links in emails. Make sure not to add a trailing slash! # Used for generating links in emails. Make sure not to add a trailing slash!
@@ -30,6 +30,8 @@ REPORT_DASHBOARD_URL='http://127.0.0.1'
INTRNT_RUN='schedule' INTRNT_RUN='schedule'
ARPSCAN_RUN='schedule' ARPSCAN_RUN='schedule'
NSLOOKUP_RUN='before_name_updates' NSLOOKUP_RUN='before_name_updates'
AVAHISCAN_RUN='before_name_updates'
NBTSCAN_RUN='before_name_updates'
# Email # Email
#------------------------------------- #-------------------------------------

View File

@@ -67,7 +67,6 @@ services:
- ${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

@@ -52,7 +52,7 @@
{ "elementType": "select", "elementOptions": [], "transformers": [] } { "elementType": "select", "elementOptions": [], "transformers": [] }
] ]
}, },
"default_value": "before_name_updates", "default_value": "disabled",
"options": [ "options": [
"disabled", "disabled",
"before_name_updates", "before_name_updates",

View File

@@ -178,15 +178,15 @@
"description": [ "description": [
{ {
"language_code": "en_us", "language_code": "en_us",
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#NBTSCAN_RUN\"><code>NBTSCAN_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes." "string": "Only enabled if you select <code>schedule</code> in the <a href=\"#DIGSCAN_RUN\"><code>DIGSCAN_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
}, },
{ {
"language_code": "es_es", "language_code": "es_es",
"string": "Solo está habilitado si selecciona <code>schedule</code> en la configuración <a href=\"#NBTSCAN_RUN\"><code>NBTSCAN_RUN</code></a>. Asegúrese de ingresar la programación en el formato similar a cron correcto (por ejemplo, valide en <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutará el escaneo después de las 4 a.m. en el <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ código> que configuró arriba</a>. Se ejecutará la PRÓXIMA vez que pase el tiempo." "string": "Solo está habilitado si selecciona <code>schedule</code> en la configuración <a href=\"#DIGSCAN_RUN\"><code>DIGSCAN_RUN</code></a>. Asegúrese de ingresar la programación en el formato similar a cron correcto (por ejemplo, valide en <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Por ejemplo, ingresar <code>0 4 * * *</code> ejecutará el escaneo después de las 4 a.m. en el <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ código> que configuró arriba</a>. Se ejecutará la PRÓXIMA vez que pase el tiempo."
}, },
{ {
"language_code": "de_de", "language_code": "de_de",
"string": "Nur aktiviert, wenn Sie <code>schedule</code> in der <a href=\"#NBTSCAN_RUN\"><code>NBTSCAN_RUN</code>-Einstellung</a> auswählen. Stellen Sie sicher, dass Sie den Zeitplan im richtigen Cron-ähnlichen Format eingeben (z. B. validieren unter <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Wenn Sie beispielsweise <code>0 4 * * *</code> eingeben, wird der Scan nach 4 Uhr morgens in der <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ ausgeführt. Code> den Sie oben festgelegt haben</a>. Wird das NÄCHSTE Mal ausgeführt, wenn die Zeit vergeht." "string": "Nur aktiviert, wenn Sie <code>schedule</code> in der <a href=\"#DIGSCAN_RUN\"><code>DIGSCAN_RUN</code>-Einstellung</a> auswählen. Stellen Sie sicher, dass Sie den Zeitplan im richtigen Cron-ähnlichen Format eingeben (z. B. validieren unter <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). Wenn Sie beispielsweise <code>0 4 * * *</code> eingeben, wird der Scan nach 4 Uhr morgens in der <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</ ausgeführt. Code> den Sie oben festgelegt haben</a>. Wird das NÄCHSTE Mal ausgeführt, wenn die Zeit vergeht."
} }
] ]
}, },

View File

@@ -52,7 +52,7 @@
{ "elementType": "select", "elementOptions": [], "transformers": [] } { "elementType": "select", "elementOptions": [], "transformers": [] }
] ]
}, },
"default_value": "before_name_updates", "default_value": "disabled",
"options": [ "options": [
"disabled", "disabled",
"before_name_updates", "before_name_updates",

View File

@@ -12,7 +12,7 @@ import sys
import requests import requests
from requests import Request, Session, packages from requests import Request, Session, packages
from requests.packages.urllib3.exceptions import InsecureRequestWarning from requests.packages.urllib3.exceptions import InsecureRequestWarning
from pyunifi.controller import Controller from nax_pyunifi.controller import Controller
# Register NetAlertX directories # Register NetAlertX directories
@@ -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, API_KEY global UNIFI_USERNAME, UNIFI_PASSWORD, UNIFI_HOST, UNIFI_SITES, PORT, VERIFYSSL, VERSION, FULL_IMPORT
# parse output # parse output
plugin_objects = Plugin_Objects(RESULT_FILE) plugin_objects = Plugin_Objects(RESULT_FILE)
@@ -65,10 +65,6 @@ 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)
@@ -100,19 +96,6 @@ def get_entries(plugin_objects: Plugin_Objects) -> Plugin_Objects:
mylog('verbose', [f'[{pluginName}] site: {site}']) mylog('verbose', [f'[{pluginName}] site: {site}'])
# def __init__(
# self,
# host,
# username=None,
# password=None,
# port=8443,
# version="v5",
# site_id="default",
# ssl_verify=True,
# api_key=None
# ):
c = Controller( c = Controller(
UNIFI_HOST, UNIFI_HOST,
UNIFI_USERNAME, UNIFI_USERNAME,
@@ -120,8 +103,7 @@ def get_entries(plugin_objects: Plugin_Objects) -> Plugin_Objects:
port=PORT, port=PORT,
version=VERSION, version=VERSION,
ssl_verify=VERIFYSSL, ssl_verify=VERIFYSSL,
site_id=site, site_id=site)
api_key=API_KEY)
online_macs = set() online_macs = set()
processed_macs = [] processed_macs = []

View File

@@ -3,6 +3,7 @@
import argparse import argparse
import requests import requests
from requests.exceptions import SSLError, Timeout, RequestException
import pathlib import pathlib
import sys import sys
import os import os