This commit is contained in:
jokob-sk
2024-08-11 21:13:42 +10:00
10 changed files with 707 additions and 120 deletions

1
.gitignore vendored
View File

@@ -20,6 +20,7 @@ __pycache__/
**/script.log **/script.log
**/pialert.conf_bak **/pialert.conf_bak
**/pialert.db_bak **/pialert.db_bak
.*.swp
front/img/account/* front/img/account/*
**/account.php **/account.php

View File

@@ -15,7 +15,7 @@ ENV PATH="/opt/venv/bin:$PATH"
COPY . ${INSTALL_DIR}/ COPY . ${INSTALL_DIR}/
RUN pip install netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython \ RUN pip install netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros \
&& bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \ && bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f -exec chmod 640 {} \;" \ && bash -c "find ${INSTALL_DIR} -type f -exec chmod 640 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f \( -name '*.sh' -o -name '*.py' -o -name 'speedtest-cli' \) -exec chmod 750 {} \;" && bash -c "find ${INSTALL_DIR} -type f \( -name '*.sh' -o -name '*.py' -o -name 'speedtest-cli' \) -exec chmod 750 {} \;"

0
front/log/.gitignore vendored Executable file → Normal file
View File

82
front/php/templates/language/de_de.json Executable file → Normal file
View File

@@ -28,7 +28,7 @@
"AppEvents_ObjectPrimaryID": "Primär ID", "AppEvents_ObjectPrimaryID": "Primär ID",
"AppEvents_ObjectSecondaryID": "Sekundär ID", "AppEvents_ObjectSecondaryID": "Sekundär ID",
"AppEvents_ObjectStatus": "", "AppEvents_ObjectStatus": "",
"AppEvents_ObjectStatusColumn": "", "AppEvents_ObjectStatusColumn": "Statusspalte",
"AppEvents_ObjectType": "Objekttyp", "AppEvents_ObjectType": "Objekttyp",
"AppEvents_Plugin": "Plugin", "AppEvents_Plugin": "Plugin",
"AppEvents_Type": "Typ", "AppEvents_Type": "Typ",
@@ -98,7 +98,7 @@
"DevDetail_MainInfo_Network_Site": "", "DevDetail_MainInfo_Network_Site": "",
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Network", "DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Network",
"DevDetail_MainInfo_Owner": "Eigen&shy;tümer", "DevDetail_MainInfo_Owner": "Eigen&shy;tümer",
"DevDetail_MainInfo_SSID": "", "DevDetail_MainInfo_SSID": "SSID",
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Hauptinformation", "DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Hauptinformation",
"DevDetail_MainInfo_Type": "Typ", "DevDetail_MainInfo_Type": "Typ",
"DevDetail_MainInfo_Vendor": "Hersteller", "DevDetail_MainInfo_Vendor": "Hersteller",
@@ -126,7 +126,7 @@
"DevDetail_Run_Actions_Tooltip": "Eine Aktion aus der Dropdown-Liste auf dem aktuellen Gerät ausführen.", "DevDetail_Run_Actions_Tooltip": "Eine Aktion aus der Dropdown-Liste auf dem aktuellen Gerät ausführen.",
"DevDetail_SessionInfo_FirstSession": "Erste Sitzung", "DevDetail_SessionInfo_FirstSession": "Erste Sitzung",
"DevDetail_SessionInfo_LastIP": "Letzte IP", "DevDetail_SessionInfo_LastIP": "Letzte IP",
"DevDetail_SessionInfo_LastSession": "Letzte Sitzung", "DevDetail_SessionInfo_LastSession": "Zuletzt offline",
"DevDetail_SessionInfo_StaticIP": "Statische IP", "DevDetail_SessionInfo_StaticIP": "Statische IP",
"DevDetail_SessionInfo_Status": "Status", "DevDetail_SessionInfo_Status": "Status",
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Sitzungsinformation", "DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Sitzungsinformation",
@@ -202,7 +202,7 @@
"Device_Shortcut_Archived": "Archiviert", "Device_Shortcut_Archived": "Archiviert",
"Device_Shortcut_Connected": "Verbunden", "Device_Shortcut_Connected": "Verbunden",
"Device_Shortcut_Devices": "Geräte", "Device_Shortcut_Devices": "Geräte",
"Device_Shortcut_DownAlerts": "Offline & Nicht erreichbar", "Device_Shortcut_DownAlerts": "Nicht erreichbar & offline",
"Device_Shortcut_DownOnly": "Offline", "Device_Shortcut_DownOnly": "Offline",
"Device_Shortcut_Favorites": "Favoriten", "Device_Shortcut_Favorites": "Favoriten",
"Device_Shortcut_NewDevices": "Neue Geräte", "Device_Shortcut_NewDevices": "Neue Geräte",
@@ -210,12 +210,12 @@
"Device_TableHead_Connected_Devices": "Verbundene Geräte", "Device_TableHead_Connected_Devices": "Verbundene Geräte",
"Device_TableHead_Favorite": "Favorit", "Device_TableHead_Favorite": "Favorit",
"Device_TableHead_FirstSession": "Erste Sitzung", "Device_TableHead_FirstSession": "Erste Sitzung",
"Device_TableHead_GUID": "", "Device_TableHead_GUID": "GUID",
"Device_TableHead_Group": "Gruppe", "Device_TableHead_Group": "Gruppe",
"Device_TableHead_Icon": "Icon", "Device_TableHead_Icon": "Icon",
"Device_TableHead_LastIP": "Letzte IP", "Device_TableHead_LastIP": "Letzte IP",
"Device_TableHead_LastIPOrder": "Last IP Order", "Device_TableHead_LastIPOrder": "Last IP Order",
"Device_TableHead_LastSession": "Letzte Sitzung", "Device_TableHead_LastSession": "Zuletzt offline",
"Device_TableHead_Location": "Standort", "Device_TableHead_Location": "Standort",
"Device_TableHead_MAC": "MAC", "Device_TableHead_MAC": "MAC",
"Device_TableHead_MAC_full": "Gesamte MAC", "Device_TableHead_MAC_full": "Gesamte MAC",
@@ -226,9 +226,9 @@
"Device_TableHead_Port": "Port", "Device_TableHead_Port": "Port",
"Device_TableHead_RowID": "Zeilen ID", "Device_TableHead_RowID": "Zeilen ID",
"Device_TableHead_Rowid": "Zeilennummer", "Device_TableHead_Rowid": "Zeilennummer",
"Device_TableHead_SSID": "", "Device_TableHead_SSID": "SSID",
"Device_TableHead_Status": "Status", "Device_TableHead_Status": "Status",
"Device_TableHead_SyncHubNodeName": "", "Device_TableHead_SyncHubNodeName": "Synchronisationsknoten",
"Device_TableHead_Type": "Typ", "Device_TableHead_Type": "Typ",
"Device_TableHead_Vendor": "Hersteller", "Device_TableHead_Vendor": "Hersteller",
"Device_Table_Not_Network_Device": "Nicht konfiguriert als Netzwerkgerät", "Device_Table_Not_Network_Device": "Nicht konfiguriert als Netzwerkgerät",
@@ -272,7 +272,7 @@
"Events_TableHead_IPOrder": "IP Order", "Events_TableHead_IPOrder": "IP Order",
"Events_TableHead_Order": "Order", "Events_TableHead_Order": "Order",
"Events_TableHead_Owner": "Eigentümer", "Events_TableHead_Owner": "Eigentümer",
"Events_TableHead_PendingAlert": "", "Events_TableHead_PendingAlert": "Ausstehender Alarm",
"Events_Table_info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen", "Events_Table_info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen",
"Events_Table_nav_next": "Nächste", "Events_Table_nav_next": "Nächste",
"Events_Table_nav_prev": "Zurück", "Events_Table_nav_prev": "Zurück",
@@ -280,9 +280,9 @@
"Events_Tablelenght_all": "Alle", "Events_Tablelenght_all": "Alle",
"Events_Title": "Ereignisse", "Events_Title": "Ereignisse",
"Gen_Action": "Action", "Gen_Action": "Action",
"Gen_Add": "", "Gen_Add": "Hinzufügen",
"Gen_Add_All": "", "Gen_Add_All": "Alle hinzufügen",
"Gen_All_Devices": "", "Gen_All_Devices": "Alle Geräte",
"Gen_AreYouSure": "Sind Sie sich sicher?", "Gen_AreYouSure": "Sind Sie sich sicher?",
"Gen_Backup": "Sichern", "Gen_Backup": "Sichern",
"Gen_Cancel": "Abbrechen", "Gen_Cancel": "Abbrechen",
@@ -291,25 +291,25 @@
"Gen_Delete": "Löschen", "Gen_Delete": "Löschen",
"Gen_DeleteAll": "Delete all", "Gen_DeleteAll": "Delete all",
"Gen_Error": "Fehler", "Gen_Error": "Fehler",
"Gen_Filter": "", "Gen_Filter": "Filter",
"Gen_LockedDB": "ERROR - DB eventuell gesperrt - Nutze die Konsole in den Entwickler Werkzeugen (F12) zur Überprüfung oder probiere es später erneut.", "Gen_LockedDB": "ERROR - DB eventuell gesperrt - Nutze die Konsole in den Entwickler Werkzeugen (F12) zur Überprüfung oder probiere es später erneut.",
"Gen_Offline": "", "Gen_Offline": "Offline",
"Gen_Okay": "Ok", "Gen_Okay": "Ok",
"Gen_Purge": "Aufräumen", "Gen_Purge": "Aufräumen",
"Gen_ReadDocs": "Mehr in der Dokumentation", "Gen_ReadDocs": "Mehr in der Dokumentation",
"Gen_Remove_All": "", "Gen_Remove_All": "Alle entfernen",
"Gen_Remove_Last": "", "Gen_Remove_Last": "Letzte entfernen",
"Gen_Restore": "Wiederherstellen", "Gen_Restore": "Wiederherstellen",
"Gen_Run": "Run", "Gen_Run": "Run",
"Gen_Save": "Speichern", "Gen_Save": "Speichern",
"Gen_Saved": "Gespeichert", "Gen_Saved": "Gespeichert",
"Gen_Search": "", "Gen_Search": "Suchen",
"Gen_Selected_Devices": "Ausgewählte Geräte:", "Gen_Selected_Devices": "Ausgewählte Geräte:",
"Gen_Switch": "Umschalten", "Gen_Switch": "Umschalten",
"Gen_Upd": "Aktualisierung erfolgreich", "Gen_Upd": "Aktualisierung erfolgreich",
"Gen_Upd_Fail": "Aktualisierung fehlgeschlagen", "Gen_Upd_Fail": "Aktualisierung fehlgeschlagen",
"Gen_Update": "", "Gen_Update": "Aktualisieren",
"Gen_Update_Value": "", "Gen_Update_Value": "Wert aktualisieren",
"Gen_Warning": "Warnung", "Gen_Warning": "Warnung",
"Gen_Work_In_Progress": "Keine Finalversion, feedback bitte unter: https://github.com/jokob-sk/NetAlertX/issues", "Gen_Work_In_Progress": "Keine Finalversion, feedback bitte unter: https://github.com/jokob-sk/NetAlertX/issues",
"General_display_name": "Allgemein", "General_display_name": "Allgemein",
@@ -353,7 +353,7 @@
"HelpFAQ_Cat_Presence_401_text": "Wenn dies geschieht hast du die Möglickeit, bei dem betreffenden Gerät (Detailsansicht) die Events zu löschen. Eine andere Möglichkeit wäre, das Gerät einzuschalten und zu warten, bis NetAlertX mit dem nächsten Scan das Gerät als \"Online\" erkennt und anschließend das Gerät einfach wieder ausschalten. Nun sollte NetAlertX mit dem nächsten Scan den Zustand des Gerätes ordentlich in der Datenbank vermerken.", "HelpFAQ_Cat_Presence_401_text": "Wenn dies geschieht hast du die Möglickeit, bei dem betreffenden Gerät (Detailsansicht) die Events zu löschen. Eine andere Möglichkeit wäre, das Gerät einzuschalten und zu warten, bis NetAlertX mit dem nächsten Scan das Gerät als \"Online\" erkennt und anschließend das Gerät einfach wieder ausschalten. Nun sollte NetAlertX mit dem nächsten Scan den Zustand des Gerätes ordentlich in der Datenbank vermerken.",
"HelpFAQ_Title": "Hilfe / FAQ", "HelpFAQ_Title": "Hilfe / FAQ",
"LOADED_PLUGINS_description": "", "LOADED_PLUGINS_description": "",
"LOADED_PLUGINS_name": "", "LOADED_PLUGINS_name": "Geladene Plugins",
"LOG_LEVEL_description": "Diese Einstellung aktiviert die erweiterte Protokollierung. Nützlich fürs Debuggen von in die Datenbank geschriebenen Events.", "LOG_LEVEL_description": "Diese Einstellung aktiviert die erweiterte Protokollierung. Nützlich fürs Debuggen von in die Datenbank geschriebenen Events.",
"LOG_LEVEL_name": "Erweiterte Protokollierung", "LOG_LEVEL_name": "Erweiterte Protokollierung",
"Loading": "Laden...", "Loading": "Laden...",
@@ -384,8 +384,8 @@
"MQTT_USER_name": "MQTT user", "MQTT_USER_name": "MQTT user",
"MQTT_display_name": "MQTT", "MQTT_display_name": "MQTT",
"MQTT_icon": "<i class=\"fa fa-square-rss\"></i>", "MQTT_icon": "<i class=\"fa fa-square-rss\"></i>",
"Maint_PurgeLog": "", "Maint_PurgeLog": "Protokoll bereinigen",
"Maint_RestartServer": "", "Maint_RestartServer": "Server neu starten",
"Maint_Restart_Server_noti_text": "", "Maint_Restart_Server_noti_text": "",
"Maintenance_Running_Version": "Installierte Version", "Maintenance_Running_Version": "Installierte Version",
"Maintenance_Status": "Status", "Maintenance_Status": "Status",
@@ -398,7 +398,7 @@
"Maintenance_Tool_ImportCSV_noti": "CSV Import", "Maintenance_Tool_ImportCSV_noti": "CSV Import",
"Maintenance_Tool_ImportCSV_noti_text": "Sind Sie sich sicher, dass Sie die CSV-Datei importieren wollen? Dies wird <b>alle Geräte in der Datenbank überschreiben</b>.", "Maintenance_Tool_ImportCSV_noti_text": "Sind Sie sich sicher, dass Sie die CSV-Datei importieren wollen? Dies wird <b>alle Geräte in der Datenbank überschreiben</b>.",
"Maintenance_Tool_ImportCSV_text": "Machen Sie ein Backup, bevor Sie diese Funk­tion nutzen. Importiere eine CSV-Datei (comma separated values) mit einer Liste aller Geräte und deren Beziehungen zwischen Netzwerkknoten und verbundenen Geräten. Um dies zu tun platziere die <b>devices.csv</b> benannte CSV-Datei in deinen <b>/config</b> Ordner.", "Maintenance_Tool_ImportCSV_text": "Machen Sie ein Backup, bevor Sie diese Funk­tion nutzen. Importiere eine CSV-Datei (comma separated values) mit einer Liste aller Geräte und deren Beziehungen zwischen Netzwerkknoten und verbundenen Geräten. Um dies zu tun platziere die <b>devices.csv</b> benannte CSV-Datei in deinen <b>/config</b> Ordner.",
"Maintenance_Tool_ImportPastedCSV": "", "Maintenance_Tool_ImportPastedCSV": "CSV-Import (Einfügen)",
"Maintenance_Tool_ImportPastedCSV_noti_text": "", "Maintenance_Tool_ImportPastedCSV_noti_text": "",
"Maintenance_Tool_ImportPastedCSV_text": "", "Maintenance_Tool_ImportPastedCSV_text": "",
"Maintenance_Tool_arpscansw": "arp-Scan stoppen/starten", "Maintenance_Tool_arpscansw": "arp-Scan stoppen/starten",
@@ -493,7 +493,7 @@
"NTFY_USER_name": "NTFY user", "NTFY_USER_name": "NTFY user",
"NTFY_display_name": "NTFY", "NTFY_display_name": "NTFY",
"NTFY_icon": "<i class=\"fa fa-terminal\"></i>", "NTFY_icon": "<i class=\"fa fa-terminal\"></i>",
"Navigation_About": "", "Navigation_About": "Über",
"Navigation_Devices": "Geräte", "Navigation_Devices": "Geräte",
"Navigation_Donations": "Donations", "Navigation_Donations": "Donations",
"Navigation_Events": "Ereignisse", "Navigation_Events": "Ereignisse",
@@ -503,10 +503,10 @@
"Navigation_Maintenance": "Wartung", "Navigation_Maintenance": "Wartung",
"Navigation_Monitoring": "Überwachung", "Navigation_Monitoring": "Überwachung",
"Navigation_Network": "Netzwerk", "Navigation_Network": "Netzwerk",
"Navigation_Notifications": "", "Navigation_Notifications": "Benachrichtigungen",
"Navigation_Plugins": "Plugins", "Navigation_Plugins": "Plugins",
"Navigation_Presence": "Anwesenheit", "Navigation_Presence": "Anwesenheit",
"Navigation_Report": "Bericht", "Navigation_Report": "Gesendete Berichte",
"Navigation_Settings": "Einstellungen", "Navigation_Settings": "Einstellungen",
"Navigation_SystemInfo": "Systeminfo", "Navigation_SystemInfo": "Systeminfo",
"Navigation_Workflows": "Arbeitsabläufe", "Navigation_Workflows": "Arbeitsabläufe",
@@ -545,7 +545,7 @@
"Network_Node": "Netzwerkknoten", "Network_Node": "Netzwerkknoten",
"Network_Node_Name": "Knotenname", "Network_Node_Name": "Knotenname",
"Network_Parent": "Übergeordnetes Netzwerkgerät", "Network_Parent": "Übergeordnetes Netzwerkgerät",
"Network_Root": "", "Network_Root": "Wurzelknoten",
"Network_Root_Not_Configured": "", "Network_Root_Not_Configured": "",
"Network_Root_Unconfigurable": "Nicht konfigurierbare Wurzel", "Network_Root_Unconfigurable": "Nicht konfigurierbare Wurzel",
"Network_Table_Hostname": "Gerätename", "Network_Table_Hostname": "Gerätename",
@@ -553,8 +553,8 @@
"Network_Table_State": "Status", "Network_Table_State": "Status",
"Network_Title": "Netzwerkübersicht", "Network_Title": "Netzwerkübersicht",
"Network_UnassignedDevices": "Nicht zugewiesene Geräte", "Network_UnassignedDevices": "Nicht zugewiesene Geräte",
"Notifications_All": "", "Notifications_All": "Alle Benachrichtigungen",
"Notifications_Mark_All_Read": "", "Notifications_Mark_All_Read": "Alle als gelesen markieren",
"PIALERT_WEB_PASSWORD_description": "Das Standardpasswort ist <code>123456</code>. Um das Passwort zu ändern, entweder <code>/app/back/pialert-cli</code> im Container starten oder <a onclick=\"toggleAllSettings()\" href=\"#SETPWD_RUN\"><code>SETPWD_RUN</code> Set password plugin</a> nutzen.", "PIALERT_WEB_PASSWORD_description": "Das Standardpasswort ist <code>123456</code>. Um das Passwort zu ändern, entweder <code>/app/back/pialert-cli</code> im Container starten oder <a onclick=\"toggleAllSettings()\" href=\"#SETPWD_RUN\"><code>SETPWD_RUN</code> Set password plugin</a> nutzen.",
"PIALERT_WEB_PASSWORD_name": "Login-Passwort", "PIALERT_WEB_PASSWORD_name": "Login-Passwort",
"PIALERT_WEB_PROTECTION_description": "Ein Loginfenster wird angezeigt wenn aktiviert. Untere Beschreibung genau durchlesen falls Sie sich aus Ihrer Instanz aussperren.", "PIALERT_WEB_PROTECTION_description": "Ein Loginfenster wird angezeigt wenn aktiviert. Untere Beschreibung genau durchlesen falls Sie sich aus Ihrer Instanz aussperren.",
@@ -609,8 +609,8 @@
"REPORT_WEBHOOK_description": "Enable webhooks for notifications. Webhooks help you to connect to a lot of 3rd party tools, such as IFTTT, Zapier or <a href=\"https://n8n.io/\" target=\"_blank\">n8n</a> to name a few. Check out this simple <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md\" target=\"_blank\">n8n guide here</a> to get started. If enabled, configure related settings below.", "REPORT_WEBHOOK_description": "Enable webhooks for notifications. Webhooks help you to connect to a lot of 3rd party tools, such as IFTTT, Zapier or <a href=\"https://n8n.io/\" target=\"_blank\">n8n</a> to name a few. Check out this simple <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md\" target=\"_blank\">n8n guide here</a> to get started. If enabled, configure related settings below.",
"REPORT_WEBHOOK_name": "Enable Webhooks", "REPORT_WEBHOOK_name": "Enable Webhooks",
"RandomMAC_hover": "Autodetected - indicates if the device randomizes it's MAC address.", "RandomMAC_hover": "Autodetected - indicates if the device randomizes it's MAC address.",
"Reports_Sent_Log": "", "Reports_Sent_Log": "Protokoll gesendeter Berichte",
"SCAN_SUBNETS_description": "Arp-scan is a command-line tool that uses the ARP protocol to discover and fingerprint IP hosts on the local network. An alternative to ARP scan is to enable the <a onclick=\"toggleAllSettings()\" href=\"#PIHOLE_RUN\"><code>PIHOLE_RUN</code>PiHole integration settings</a>. The arp-scan time itself depends on the number of IP addresses to check so set this up carefully with the appropriate network mask and interface. Check the <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">subnets documentation</a> for help on setting up VLANs, what VLANs are supported, or how to figure out the network mask and your interface.", "SCAN_SUBNETS_description": "",
"SMTP_FORCE_SSL_description": "Force SSL when connecting to your SMTP server.", "SMTP_FORCE_SSL_description": "Force SSL when connecting to your SMTP server.",
"SMTP_FORCE_SSL_name": "Force SSL", "SMTP_FORCE_SSL_name": "Force SSL",
"SMTP_PASS_description": "The SMTP server password. ", "SMTP_PASS_description": "The SMTP server password. ",
@@ -629,7 +629,7 @@
"Setting_Override": "Override value", "Setting_Override": "Override value",
"Setting_Override_Description": "Enabling this option will override an App supplied default value with the value specified above.", "Setting_Override_Description": "Enabling this option will override an App supplied default value with the value specified above.",
"Settings_Metadata_Toggle": "Show/hide metadata for the given setting.", "Settings_Metadata_Toggle": "Show/hide metadata for the given setting.",
"Settings_device_Scanners_desync": "", "Settings_device_Scanners_desync": "⚠ Die Zeitpläne des Gerätescanners sind nicht synchronisiert.",
"Settings_device_Scanners_desync_popup": "", "Settings_device_Scanners_desync_popup": "",
"Speedtest_Results": "Ergebnisse des Geschwindigkeitstests", "Speedtest_Results": "Ergebnisse des Geschwindigkeitstests",
"Systeminfo_CPU": "CPU", "Systeminfo_CPU": "CPU",
@@ -744,29 +744,29 @@
"report_time": "Benachrichtigungszeit:", "report_time": "Benachrichtigungszeit:",
"run_event_icon": "fa-play", "run_event_icon": "fa-play",
"run_event_tooltip": "Enable the setting and save your changes at first before you run it.", "run_event_tooltip": "Enable the setting and save your changes at first before you run it.",
"settings_core_icon": "fa-solid fa-gem", "settings_core_icon": "",
"settings_core_label": "", "settings_core_label": "Kern",
"settings_device_scanners": "", "settings_device_scanners": "",
"settings_device_scanners_icon": "fa-solid fa-magnifying-glass-plus", "settings_device_scanners_icon": "",
"settings_device_scanners_info": "", "settings_device_scanners_info": "",
"settings_device_scanners_label": "Gerätescanner", "settings_device_scanners_label": "Gerätescanner",
"settings_enabled": "Aktive Einstellungen", "settings_enabled": "Aktive Einstellungen",
"settings_enabled_icon": "fa-solid fa-toggle-on", "settings_enabled_icon": "",
"settings_expand_all": "Expand all", "settings_expand_all": "Expand all",
"settings_imported": "Last time settings were imported from the app.conf file:", "settings_imported": "Last time settings were imported from the app.conf file:",
"settings_imported_label": "Einstellungen importiert", "settings_imported_label": "Einstellungen importiert",
"settings_missing": "Not all settings loaded, refresh the page! This is probably caused by a high load on the database or app startup sequence.", "settings_missing": "",
"settings_missing_block": "You can not save your settings without specifying all setting keys. Refresh the page. This is probably caused by a high load on the database.", "settings_missing_block": "",
"settings_old": "Importing settings and re-initializing...", "settings_old": "Importing settings and re-initializing...",
"settings_other_scanners": "", "settings_other_scanners": "",
"settings_other_scanners_icon": "fa-solid fa-recycle", "settings_other_scanners_icon": "",
"settings_other_scanners_label": "Andere Scanner", "settings_other_scanners_label": "Andere Scanner",
"settings_publishers": "", "settings_publishers": "",
"settings_publishers_icon": "fa-solid fa-paper-plane", "settings_publishers_icon": "fa-solid fa-paper-plane",
"settings_publishers_info": "", "settings_publishers_info": "",
"settings_publishers_label": "Veröffentlicher", "settings_publishers_label": "Veröffentlicher",
"settings_saved": "<br/>Settings saved to the <code>app.conf</code> file.<br/><br/>A time-stamped backup of the previous file created. <br/><br/> Reloading...<br/>", "settings_saved": "",
"settings_system_icon": "fa-solid fa-gear", "settings_system_icon": "",
"settings_system_label": "System", "settings_system_label": "System",
"settings_update_item_warning": "", "settings_update_item_warning": "",
"test_event_icon": "fa-vial-circle-check", "test_event_icon": "fa-vial-circle-check",

12
front/php/templates/language/fr_fr.json Executable file → Normal file
View File

@@ -8,7 +8,7 @@
"About_Title": "Analyse de la sécurité du réseau et cadre de notification", "About_Title": "Analyse de la sécurité du réseau et cadre de notification",
"AppEvents_DateTimeCreated": "Journalisé", "AppEvents_DateTimeCreated": "Journalisé",
"AppEvents_Extra": "Extra", "AppEvents_Extra": "Extra",
"AppEvents_GUID": "", "AppEvents_GUID": "GUID dévénement dapplication",
"AppEvents_Helper1": "Helper 1", "AppEvents_Helper1": "Helper 1",
"AppEvents_Helper2": "Helper 2", "AppEvents_Helper2": "Helper 2",
"AppEvents_Helper3": "Helper 3", "AppEvents_Helper3": "Helper 3",
@@ -35,7 +35,7 @@
"BackDevices_Arpscan_enabled": "Apr-Scan Activé", "BackDevices_Arpscan_enabled": "Apr-Scan Activé",
"BackDevices_Backup_CopError": "La base de donnée initiale n'a pas pu être sauvegardée.", "BackDevices_Backup_CopError": "La base de donnée initiale n'a pas pu être sauvegardée.",
"BackDevices_Backup_Failed": "La sauvegarde a été partiellement complétée. L'archive n'a pas pu être crée ou est vide.", "BackDevices_Backup_Failed": "La sauvegarde a été partiellement complétée. L'archive n'a pas pu être crée ou est vide.",
"BackDevices_Backup_okay": "", "BackDevices_Backup_okay": "La sauvegarde s'est déroulée avec succès avec la nouvelle archive",
"BackDevices_DBTools_DelDevError_a": "Erreur lors de la suppression de l'appareil", "BackDevices_DBTools_DelDevError_a": "Erreur lors de la suppression de l'appareil",
"BackDevices_DBTools_DelDevError_b": "Erreur lors de la suppression des appareils", "BackDevices_DBTools_DelDevError_b": "Erreur lors de la suppression des appareils",
"BackDevices_DBTools_DelDev_a": "Appareil supprimé", "BackDevices_DBTools_DelDev_a": "Appareil supprimé",
@@ -56,15 +56,15 @@
"BackDevices_Restore_okay": "Restauration exécutée avec succès.", "BackDevices_Restore_okay": "Restauration exécutée avec succès.",
"BackDevices_darkmode_disabled": "Mode sombre désactivé", "BackDevices_darkmode_disabled": "Mode sombre désactivé",
"BackDevices_darkmode_enabled": "Mode sombre activé", "BackDevices_darkmode_enabled": "Mode sombre activé",
"DAYS_TO_KEEP_EVENTS_description": "", "DAYS_TO_KEEP_EVENTS_description": "Il s'agit d'un paramètre de maintenance. Il indique le nombre de jours pendant lesquels les entrées d'événements seront conservées. Tous les événements plus anciens seront supprimés périodiquement. S'applique également à l'historique des événements du plugin.",
"DAYS_TO_KEEP_EVENTS_name": "Supprimer les événements plus anciens que", "DAYS_TO_KEEP_EVENTS_name": "Supprimer les événements plus anciens que",
"DevDetail_Copy_Device_Title": "", "DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copier les détails de l'appareil",
"DevDetail_Copy_Device_Tooltip": "", "DevDetail_Copy_Device_Tooltip": "Copier les détails de l'appareil dans la liste déroulante. Tout ce qui se trouve sur cette page sera écrasé",
"DevDetail_EveandAl_AlertAllEvents": "Alerter tous les événements", "DevDetail_EveandAl_AlertAllEvents": "Alerter tous les événements",
"DevDetail_EveandAl_AlertDown": "Alerte de panne", "DevDetail_EveandAl_AlertDown": "Alerte de panne",
"DevDetail_EveandAl_Archived": "Archivés", "DevDetail_EveandAl_Archived": "Archivés",
"DevDetail_EveandAl_NewDevice": "Nouvel appareil", "DevDetail_EveandAl_NewDevice": "Nouvel appareil",
"DevDetail_EveandAl_NewDevice_Tooltip": "", "DevDetail_EveandAl_NewDevice_Tooltip": "Affiche le statut Nouveau pour l'appareil et l'inclut dans les listes lorsque le filtre Nouveaux Appareils est actif. N'affecte pas les notifications.",
"DevDetail_EveandAl_RandomMAC": "MAC aléatoire", "DevDetail_EveandAl_RandomMAC": "MAC aléatoire",
"DevDetail_EveandAl_ScanCycle": "", "DevDetail_EveandAl_ScanCycle": "",
"DevDetail_EveandAl_ScanCycle_a": "", "DevDetail_EveandAl_ScanCycle_a": "",

138
front/php/templates/language/pt_br.json Executable file → Normal file
View File

@@ -3,7 +3,7 @@
"API_CUSTOM_SQL_name": "Endpoint customizado", "API_CUSTOM_SQL_name": "Endpoint customizado",
"API_display_name": "API", "API_display_name": "API",
"API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>", "API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>",
"About_Design": "Desenhado por:", "About_Design": "Desenvolvido por:",
"About_Exit": "Sair", "About_Exit": "Sair",
"About_Title": "Analisador de segurança de rede & framework de notificação", "About_Title": "Analisador de segurança de rede & framework de notificação",
"AppEvents_DateTimeCreated": "Registrado em", "AppEvents_DateTimeCreated": "Registrado em",
@@ -145,7 +145,7 @@
"DevDetail_Tab_NmapTableText": "Configure uma programação em <a href=\"/settings.php#NMAP_ACTIVE\">Configurações</a>", "DevDetail_Tab_NmapTableText": "Configure uma programação em <a href=\"/settings.php#NMAP_ACTIVE\">Configurações</a>",
"DevDetail_Tab_NmapTableTime": "Tempo", "DevDetail_Tab_NmapTableTime": "Tempo",
"DevDetail_Tab_Plugins": "<i class=\"fa fa-plug\"> </i> Plugins", "DevDetail_Tab_Plugins": "<i class=\"fa fa-plug\"> </i> Plugins",
"DevDetail_Tab_Presence": "<i class=\"fa fa-calendar\"> Presença", "DevDetail_Tab_Presence": "<i class=\"fa fa-calendar\"></i> Presença",
"DevDetail_Tab_Sessions": "<i class=\"fa fa-list-ol\"></i> Sessões", "DevDetail_Tab_Sessions": "<i class=\"fa fa-list-ol\"></i> Sessões",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Ferramentas", "DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Ferramentas",
"DevDetail_Tab_Tools_Internet_Info_Description": "A ferramenta info Internet exibe informações sobre a conexão com a Internet, como endereço IP, cidade, país, código de área e fuso horário.", "DevDetail_Tab_Tools_Internet_Info_Description": "A ferramenta info Internet exibe informações sobre a conexão com a Internet, como endereço IP, cidade, país, código de área e fuso horário.",
@@ -202,7 +202,7 @@
"Device_TableHead_Group": "Grupo", "Device_TableHead_Group": "Grupo",
"Device_TableHead_Icon": "Ícone", "Device_TableHead_Icon": "Ícone",
"Device_TableHead_LastIP": "Último IP", "Device_TableHead_LastIP": "Último IP",
"Device_TableHead_LastIPOrder": "", "Device_TableHead_LastIPOrder": "Último pedido de IP",
"Device_TableHead_LastSession": "Último off-line", "Device_TableHead_LastSession": "Último off-line",
"Device_TableHead_Location": "Localização", "Device_TableHead_Location": "Localização",
"Device_TableHead_MAC": "MAC aleatório", "Device_TableHead_MAC": "MAC aleatório",
@@ -233,7 +233,7 @@
"ENABLE_PLUGINS_description": "Ativa a funcionalidade de <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins\">plugins</a>. Carregar plug-ins requer mais recursos de hardware, então você pode querer desativá-los em sistemas de baixa potência.", "ENABLE_PLUGINS_description": "Ativa a funcionalidade de <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins\">plugins</a>. Carregar plug-ins requer mais recursos de hardware, então você pode querer desativá-los em sistemas de baixa potência.",
"ENABLE_PLUGINS_name": "Habilitar plug-ins", "ENABLE_PLUGINS_name": "Habilitar plug-ins",
"Email_display_name": "Email", "Email_display_name": "Email",
"Email_icon": "<i class=\"fa fa-at\">", "Email_icon": "<i class=\"fa fa-at\"></i>",
"Events_Loading": "Carregando...", "Events_Loading": "Carregando...",
"Events_Periodselect_All": "Todas as informações", "Events_Periodselect_All": "Todas as informações",
"Events_Periodselect_LastMonth": "Mês passado", "Events_Periodselect_LastMonth": "Mês passado",
@@ -242,7 +242,7 @@
"Events_Periodselect_today": "Hoje", "Events_Periodselect_today": "Hoje",
"Events_Searchbox": "Procurar", "Events_Searchbox": "Procurar",
"Events_Shortcut_AllEvents": "Todos os eventos", "Events_Shortcut_AllEvents": "Todos os eventos",
"Events_Shortcut_DownAlerts": "", "Events_Shortcut_DownAlerts": "Alertas de queda",
"Events_Shortcut_Events": "Eventos", "Events_Shortcut_Events": "Eventos",
"Events_Shortcut_MissSessions": "Sessões ausentes", "Events_Shortcut_MissSessions": "Sessões ausentes",
"Events_Shortcut_NewDevices": "Novos dispositivos", "Events_Shortcut_NewDevices": "Novos dispositivos",
@@ -254,76 +254,76 @@
"Events_TableHead_Device": "Dispositivo", "Events_TableHead_Device": "Dispositivo",
"Events_TableHead_Disconnection": "Desconexão", "Events_TableHead_Disconnection": "Desconexão",
"Events_TableHead_Duration": "Duração", "Events_TableHead_Duration": "Duração",
"Events_TableHead_DurationOrder": "", "Events_TableHead_DurationOrder": "Duração do pedido",
"Events_TableHead_EventType": "Tipo de evento", "Events_TableHead_EventType": "Tipo de evento",
"Events_TableHead_IP": "IP", "Events_TableHead_IP": "IP",
"Events_TableHead_IPOrder": "", "Events_TableHead_IPOrder": "Pedido de IP",
"Events_TableHead_Order": "Ordem", "Events_TableHead_Order": "Ordem",
"Events_TableHead_Owner": "Proprietário", "Events_TableHead_Owner": "Proprietário",
"Events_TableHead_PendingAlert": "", "Events_TableHead_PendingAlert": "Alerta Pendente",
"Events_Table_info": "", "Events_Table_info": "Mostrando_START_ to _END_ of _TOTAL_ entradas",
"Events_Table_nav_next": "", "Events_Table_nav_next": "Próxima",
"Events_Table_nav_prev": "", "Events_Table_nav_prev": "Anterior",
"Events_Tablelenght": "", "Events_Tablelenght": "Mostrar entradas do _MENU_",
"Events_Tablelenght_all": "", "Events_Tablelenght_all": "Todos",
"Events_Title": "", "Events_Title": "Eventos",
"Gen_Action": "", "Gen_Action": "Ação",
"Gen_Add": "", "Gen_Add": "Adicionar",
"Gen_Add_All": "", "Gen_Add_All": "Adicionar todos",
"Gen_All_Devices": "", "Gen_All_Devices": "Todos os Dispositivos",
"Gen_AreYouSure": "", "Gen_AreYouSure": "Tem certeza?",
"Gen_Backup": "", "Gen_Backup": "Executar backup",
"Gen_Cancel": "", "Gen_Cancel": "Cancelar",
"Gen_Copy": "", "Gen_Copy": "Executar",
"Gen_DataUpdatedUITakesTime": "", "Gen_DataUpdatedUITakesTime": "OK - Pode levar um tempo para a interface do usuário ser atualizada se uma verificação estiver em execução.",
"Gen_Delete": "", "Gen_Delete": "Excluir",
"Gen_DeleteAll": "", "Gen_DeleteAll": "Excluir todos",
"Gen_Error": "", "Gen_Error": "Erro",
"Gen_Filter": "", "Gen_Filter": "Filtro",
"Gen_LockedDB": "", "Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
"Gen_Offline": "", "Gen_Offline": "Offline",
"Gen_Okay": "", "Gen_Okay": "Ok",
"Gen_Purge": "", "Gen_Purge": "Purge",
"Gen_ReadDocs": "", "Gen_ReadDocs": "Leia mais em documentos.",
"Gen_Remove_All": "", "Gen_Remove_All": "Remover tudo",
"Gen_Remove_Last": "", "Gen_Remove_Last": "Remover o último",
"Gen_Restore": "", "Gen_Restore": "Executar restauração",
"Gen_Run": "", "Gen_Run": "Executar",
"Gen_Save": "", "Gen_Save": "Salvar",
"Gen_Saved": "", "Gen_Saved": "Salvo",
"Gen_Search": "", "Gen_Search": "Procurar",
"Gen_Selected_Devices": "", "Gen_Selected_Devices": "Dispositivos selecionados:",
"Gen_Switch": "", "Gen_Switch": "Trocar",
"Gen_Upd": "", "Gen_Upd": "Atualizado com sucesso",
"Gen_Upd_Fail": "", "Gen_Upd_Fail": "A atualização falhou",
"Gen_Update": "", "Gen_Update": "Atualizar",
"Gen_Update_Value": "", "Gen_Update_Value": "Atualizar valor",
"Gen_Warning": "", "Gen_Warning": "Aviso",
"Gen_Work_In_Progress": "", "Gen_Work_In_Progress": "Trabalho em andamento, um bom momento para enviar feedback em https://github.com/jokob-sk/NetAlertX/issues",
"General_display_name": "", "General_display_name": "Geral",
"General_icon": "", "General_icon": "<i class=\"fa fa-gears\"></i>",
"HRS_TO_KEEP_NEWDEV_description": "", "HRS_TO_KEEP_NEWDEV_description": "Esta é uma configuração de manutenção. Se habilitada (<code>0</code> is disabled), dispositivos marcados como <b>Novo Dispositivo</b> serão excluídos se o tempo de <b>Primeira Sessão</b> for mais antigo que as horas especificadas nesta configuração. Use esta configuração se quiser excluir automaticamente <b>Novos Dispositivos</b> após <code>X</code> horas.",
"HRS_TO_KEEP_NEWDEV_name": "", "HRS_TO_KEEP_NEWDEV_name": "Manter novos dispositivos por",
"HelpFAQ_Cat_Detail": "", "HelpFAQ_Cat_Detail": "Detalhes",
"HelpFAQ_Cat_Detail_300_head": "", "HelpFAQ_Cat_Detail_300_head": "O que significa ",
"HelpFAQ_Cat_Detail_300_text_a": "", "HelpFAQ_Cat_Detail_300_text_a": "Significa um dispositivo de rede (um dispositivo do tipo AP, Gateway, Firewall, Hypervisor, Powerline, Switch, WLAN, PLC, Roteador, Adaptador LAN USB, Adaptador Wi-Fi USB ou Internet). Tipos personalizados podem ser adicionados através da configuração <code>NETWORK_DEVICE_TYPES</code>.",
"HelpFAQ_Cat_Detail_300_text_b": "", "HelpFAQ_Cat_Detail_300_text_b": "Indica o número da porta onde o dispositivo atualmente em edição está conectado a este dispositivo de rede. Leia <a target='_blank' href='https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md'>este guia</a> para mais informações.",
"HelpFAQ_Cat_Detail_301_head_a": "", "HelpFAQ_Cat_Detail_301_head_a": "Quando está escaneando agora? ",
"HelpFAQ_Cat_Detail_301_head_b": "", "HelpFAQ_Cat_Detail_301_head_b": "",
"HelpFAQ_Cat_Detail_301_text": "", "HelpFAQ_Cat_Detail_301_text": "O intervalo de tempo entre as verificações é definido pelo 'Cronjob', que está configurado para 5min por padrão. A designação '1min' refere-se à duração esperada da verificação. Dependendo da configuração da rede, esse tempo pode variar. Para editar o cronjob, você pode usar o seguinte comando no terminal/console <span class='text-danger help_faq_code'>crontab -e</span> e alterar o intervalo.",
"HelpFAQ_Cat_Detail_302_head_a": "", "HelpFAQ_Cat_Detail_302_head_a": "",
"HelpFAQ_Cat_Detail_302_head_b": "", "HelpFAQ_Cat_Detail_302_head_b": "E por que não posso selecionar isso?",
"HelpFAQ_Cat_Detail_302_text": "", "HelpFAQ_Cat_Detail_302_text": "Alguns dispositivos modernos geram endereços MAC aleatórios por razões de privacidade, que não podem mais ser associados a nenhum fabricante e que mudam a cada nova conexão. O NetAlertX detecta se é um endereço MAC aleatório e ativa este 'campo' automaticamente. Para desativar esse comportamento, você deve verificar no seu dispositivo como desativar a randomização do endereço MAC.",
"HelpFAQ_Cat_Detail_303_head": "", "HelpFAQ_Cat_Detail_303_head": "O que é o Nmap e para que serve?",
"HelpFAQ_Cat_Detail_303_text": "", "HelpFAQ_Cat_Detail_303_text": "Nmap é um scanner de rede com múltiplas capacidades.<br>Quando um novo dispositivo aparece na sua lista, você tem a possibilidade de obter informações mais detalhadas sobre o dispositivo através da varredura do Nmap.",
"HelpFAQ_Cat_Device_200_head": "", "HelpFAQ_Cat_Device_200_head": "Eu tenho dispositivos na minha lista dos quais não sei nada. Após excluí-los, eles sempre reaparecem.",
"HelpFAQ_Cat_Device_200_text": "", "HelpFAQ_Cat_Device_200_text": "Se você usar o Pi-hole, observe que o NetAlertX recupera informações do Pi-hole. Pause o NetAlertX, vá até a página de configurações no Pi-hole e exclua o lease DHCP, se necessário. Em seguida, também no Pi-hole, vá em Ferramentas -> Rede para ver se consegue encontrar os hosts recorrentes lá. Se encontrar, exclua-os também. Agora você pode iniciar o NetAlertX novamente. Os dispositivos não devem mais aparecer.",
"HelpFAQ_Cat_General": "", "HelpFAQ_Cat_General": "Geral",
"HelpFAQ_Cat_General_100_head": "", "HelpFAQ_Cat_General_100_head": "O relógio no canto superior direito e os horários dos eventos/presença não estão corretos (diferença de horário).",
"HelpFAQ_Cat_General_100_text_a": "", "HelpFAQ_Cat_General_100_text_a": "No seu PC, o seguinte fuso horário está configurado para o ambiente PHP:",
"HelpFAQ_Cat_General_100_text_b": "", "HelpFAQ_Cat_General_100_text_b": "Se este não for o fuso horário em que você está, você deve alterar o fuso horário no arquivo de configuração do PHP. Você pode encontrá-lo neste diretório:",
"HelpFAQ_Cat_General_100_text_c": "", "HelpFAQ_Cat_General_100_text_c": "Pesquise neste arquivo pela entrada \"date.timezone\", remova o ponto e vírgula inicial \";\" se necessário, e insira o fuso horário desejado. Uma lista com os fusos horários suportados pode ser encontrada aqui (<a href='https://www.php.net/manual/en/timezones.php' target='blank'>Link</a>)",
"HelpFAQ_Cat_General_101_head": "", "HelpFAQ_Cat_General_101_head": "Minha rede parece estar lenta, o streaming fica \"congelado\".",
"HelpFAQ_Cat_General_101_text": "", "HelpFAQ_Cat_General_101_text": "",
"HelpFAQ_Cat_General_102_head": "", "HelpFAQ_Cat_General_102_head": "",
"HelpFAQ_Cat_General_102_text": "", "HelpFAQ_Cat_General_102_text": "",

4
front/php/templates/language/zh_cn.json Executable file → Normal file
View File

@@ -1,7 +1,7 @@
{ {
"API_CUSTOM_SQL_description": "", "API_CUSTOM_SQL_description": "",
"API_CUSTOM_SQL_name": "", "API_CUSTOM_SQL_name": "自定义终点",
"API_display_name": "", "API_display_name": "API",
"API_icon": "", "API_icon": "",
"About_Design": "", "About_Design": "",
"About_Exit": "", "About_Exit": "",

View File

@@ -0,0 +1,7 @@
## Overview
Plugin for device name discovery via the Mikrotik dhcp-server leases
### Usage
- Check the Settings page for details.

View File

@@ -0,0 +1,437 @@
{
"code_name": "mikrotik_scan",
"unique_prefix": "MTSCAN",
"plugin_type": "other",
"execution_order" : "Layer_4",
"enabled": true,
"data_source": "script",
"mapped_to_table": "CurrentScan",
"show_ui": true,
"localized": ["display_name", "description", "icon"],
"display_name": [
{
"language_code": "en_us",
"string": "Mikrotik (Name discovery)"
}
],
"icon": [
{
"language_code": "en_us",
"string": "<i class=\"fa-solid fa-search\"></i>"
}
],
"description": [
{
"language_code": "en_us",
"string": "A plugin to discover device names."
}
],
"params": [
{
"name": "ips",
"type": "sql",
"value": "SELECT dev_LastIP from DEVICES order by dev_MAC",
"timeoutMultiplier": true
},
{
"name": "mt_host",
"type": "setting",
"value": "MTSCAN_MT_HOST"
},
{
"name": "mt_port",
"type": "setting",
"value": "MTSCAN_MT_PORT"
},
{
"name": "mt_user",
"type": "setting",
"value": "MTSCAN_MT_USER"
},
{
"name": "mt_pass",
"type": "setting",
"value": "MTSCAN_MT_PASS"
}
],
"settings": [
{
"function": "RUN",
"events": ["run"],
"type": {
"dataType": "string",
"elements": [
{ "elementType": "select", "elementOptions": [], "transformers": [] }
]
},
"default_value": "disabled",
"options": [
"disabled",
"before_name_updates",
"on_new_device",
"once",
"schedule",
"always_after_scan"
],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "When to run"
}
],
"description": [
{
"language_code": "en_us",
"string": "When the plugin should be executed. If enabled this will execute the scan until there are no <code>(unknown)</code> or <code>(name not found)</code> devices. Setting this to <code>on_new_device</code> or a daily <code>schedule</code> is recommended."
}
]
},
{
"function": "CMD",
"type": {
"dataType": "string",
"elements": [
{
"elementType": "input",
"elementOptions": [{ "readonly": "true" }],
"transformers": []
}
]
},
"default_value": "python3 /app/front/plugins/mikrotik_scan/mikrotik.py",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Command"
}
],
"description": [
{
"language_code": "en_us",
"string": "Command to run. This can not be changed"
}
]
},
{
"function": "RUN_SCHD",
"type": {
"dataType": "string",
"elements": [
{ "elementType": "input", "elementOptions": [], "transformers": [] }
]
},
"default_value": "*/30 * * * *",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Schedule"
}
],
"description": [
{
"language_code": "en_us",
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#MKTSCAN_RUN\"><code>MKTSCAN_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."
}
]
},
{
"function": "MT_HOST",
"type": {
"dataType": "string",
"elements": [
{
"elementType": "input",
"elementOptions": [],
"transformers": []
}
]
},
"default_value": "192.168.88.1",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Mikrotik Host IP"
}
],
"description": [
{
"language_code": "en_us",
"string": "IP for Mikrotik Router"
}
]
},
{
"function": "MT_PORT",
"type": {
"dataType": "integer",
"elements": [
{
"elementType": "input",
"elementOptions": [{ "type": "number" }],
"transformers": []
}
]
},
"default_value": 8728,
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Mikrotik API Port"
}
],
"description": [
{
"language_code": "en_us",
"string": "API Port for Mikrotik Router"
}
]
},
{
"function": "MT_USER",
"type": {
"dataType": "string",
"elements": [
{
"elementType": "input",
"elementOptions": [],
"transformers": []
}
]
},
"default_value": "admin",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Mikrotik User"
}
],
"description": [
{
"language_code": "en_us",
"string": "User for Mikrotik Router"
}
]
},
{
"function": "MT_PASS",
"type": {
"dataType": "string",
"elements": [
{
"elementType": "input",
"elementOptions": [{ "type": "password" }],
"transformers": []
}
]
},
"default_value": "",
"options": [],
"localized": ["name", "description"],
"name": [
{
"language_code": "en_us",
"string": "Mikrotik Password"
}
],
"description": [
{
"language_code": "en_us",
"string": "Password for Mikrotik Router"
}
]
}
],
"database_column_definitions": [
{
"column": "Object_PrimaryID",
"mapped_to_column": "cur_MAC",
"css_classes": "col-sm-2",
"show": true,
"type": "device_name_mac",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Name"
}
]
},
{
"column": "ForeignKey",
"css_classes": "col-sm-2",
"show": true,
"type": "device_mac",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "MAC"
}
]
},
{
"column": "Object_SecondaryID",
"mapped_to_column": "cur_IP",
"css_classes": "col-sm-2",
"show": true,
"type": "device_ip",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "IP"
}
]
},
{
"column": "Watched_Value1",
"css_classes": "col-sm-2",
"show": true,
"type": "device_ip",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Lease IP"
}
]
},
{
"column": "Watched_Value2",
"mapped_to_column": "cur_Name",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Name"
}
]
},
{
"column": "Watched_Value3",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Host Name"
}
]
},
{
"column": "Watched_Value4",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Last Seen"
}
]
},
{
"column": "HelpVal1",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Comment"
}
]
},
{
"column": "Dummy",
"mapped_to_column": "cur_ScanMethod",
"mapped_to_column_data": {
"value": "MTSCAN"
},
"css_classes": "col-sm-2",
"show": false,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Scan method"
}
]
},
{
"column": "DateTimeCreated",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Created"
},
{
"language_code": "es_es",
"string": "Creado"
}
]
},
{
"column": "DateTimeChanged",
"css_classes": "col-sm-2",
"show": true,
"type": "label",
"default_value": "",
"options": [],
"localized": ["name"],
"name": [
{
"language_code": "en_us",
"string": "Changed"
},
{
"language_code": "es_es",
"string": "Cambiado"
}
]
}
]
}

View File

@@ -0,0 +1,142 @@
#!/usr/bin/env python
# test script by running:
# tbc
import os
import pathlib
import argparse
import subprocess
import sys
import hashlib
import csv
import sqlite3
import re
from io import StringIO
from datetime import datetime
# Register NetAlertX directories
INSTALL_PATH="/app"
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
from logger import mylog, append_line_to_file
from helper import timeNowTZ, get_setting_value
from const import logPath, applicationPath, fullDbPath
from database import DB
from device import Device_obj
import conf
from pytz import timezone
from librouteros import connect
from librouteros.exceptions import TrapError
# Make sure the TIMEZONE for logging is correct
conf.tz = timezone(get_setting_value('TIMEZONE'))
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
pluginName = 'MTSCAN'
def main():
mylog('verbose', [f'[{pluginName}] In script'])
mt_host = get_setting_value('MTSCAN_MT_HOST')
mt_port = get_setting_value('MTSCAN_MT_PORT')
mt_user = get_setting_value('MTSCAN_MT_USER')
mt_password = get_setting_value('MTSCAN_MT_PASS')
#mylog('verbose', [f'[{pluginName}] Router: {mt_host}:{mt_port} user: {mt_user}, pass: {mt_password}'])
# Create a database connection
db = DB() # instance of class DB
db.open()
# Initialize the Plugin obj output file
plugin_objects = Plugin_Objects(RESULT_FILE)
# Create a Device_obj instance
device_handler = Device_obj(db)
# Retrieve devices
#unknown_devices = device_handler.getUnknown()
#mylog('verbose', [f'[{pluginName}] Unknown devices count: {len(unknown_devices)}'])
all_devices = device_handler.getAll()
mylog('verbose', [f'[{pluginName}] all devices count: {len(all_devices)}'])
device_map = {d['dev_MAC']:d['dev_LastIP'] for d in all_devices}
try:
# connect router
api = connect(username=mt_user, password=mt_password, host=mt_host, port=mt_port)
# get dhcp leases
leases = api('/ip/dhcp-server/lease/print')
for lease in leases:
lease_id = lease.get('.id')
address = lease.get('address')
mac_address = lease.get('mac-address').lower()
host_name = lease.get('host-name')
comment = lease.get('comment')
last_seen = lease.get('last-seen')
mylog('verbose', [f"ID: {lease_id}, Address: {address}, MAC Address: {mac_address}, Host Name: {host_name}, Comment: {comment}, Last Seen: {last_seen}"])
if mac_address in device_map.keys():
device_name = host_name
if comment != '':
device_name = comment
plugin_objects.add_object(
# "Name-MAC", "LastIP", "IP", "Name","Host","LastSeen","Comment"
primaryId = mac_address,
secondaryId = device_map[mac_address],
watched1 = address,
watched2 = device_name,
watched3 = host_name,
watched4 = last_seen,
extra = '',
helpVal1 = comment,
foreignKey = mac_address)
plugin_objects.write_result_file()
except TrapError as e:
mylog('error', [f"An error occurred: {e}"])
except Exception as e:
mylog('error', [f"Failed to connect to MikroTik API: {e}"])
#for device in unknown_devices:
# domain_name, dns_server = execute_nslookup(device['dev_LastIP'], timeout)
# if domain_name != '':
# plugin_objects.add_object(
# # "MAC", "IP", "Server", "Name"
# primaryId = device['dev_MAC'],
# secondaryId = device['dev_LastIP'],
# watched1 = dns_server,
# watched2 = domain_name,
# watched3 = '',
# watched4 = '',
# extra = '',
# foreignKey = device['dev_MAC'])
#plugin_objects.write_result_file()
mylog('verbose', [f'[{pluginName}] Script finished'])
return 0
#===============================================================================
# BEGIN
#===============================================================================
if __name__ == '__main__':
main()