mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Compare commits
49 Commits
8acb0a876a
...
fix-pr-130
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dee812ce6 | ||
|
|
5c44fd8fea | ||
|
|
bd691f01b1 | ||
|
|
624fd87ee7 | ||
|
|
5d1c63375b | ||
|
|
8c982cd476 | ||
|
|
36e5751221 | ||
|
|
5af760f5ee | ||
|
|
dfd836527e | ||
|
|
8d5a663817 | ||
|
|
fbb4a2f8b4 | ||
|
|
54bce6505b | ||
|
|
6da47cc830 | ||
|
|
9cabbf3622 | ||
|
|
6c28a08bee | ||
|
|
86e3decd4e | ||
|
|
e14e0bb9e8 | ||
|
|
b6023d1373 | ||
|
|
1812cc8ef8 | ||
|
|
e64c490c8a | ||
|
|
5df39f984a | ||
|
|
d007ed711a | ||
|
|
61824abb9f | ||
|
|
33c5548fe1 | ||
|
|
fd41c395ae | ||
|
|
1a980844f0 | ||
|
|
82e018e284 | ||
|
|
e0e1233b1c | ||
|
|
74677f940e | ||
|
|
21a4d20579 | ||
|
|
9634e4e0f7 | ||
|
|
00a47ab5d3 | ||
|
|
59b417705e | ||
|
|
525d082f3d | ||
|
|
ba3481759b | ||
|
|
7125cea29b | ||
|
|
8586c5a307 | ||
|
|
0d81315809 | ||
|
|
8f193f1e2c | ||
|
|
b1eef8aa09 | ||
|
|
531b66effe | ||
|
|
5e4ad10fe0 | ||
|
|
541b932b6d | ||
|
|
2bf3ff9f00 | ||
|
|
2da17f272c | ||
|
|
7bcb4586b2 | ||
|
|
d3326b3362 | ||
|
|
b9d3f430fe | ||
|
|
067336dcc1 |
3
.github/copilot-instructions.md
vendored
3
.github/copilot-instructions.md
vendored
@@ -39,10 +39,11 @@ Backend loop phases (see `server/__main__.py` and `server/plugin.py`): `once`, `
|
|||||||
## API/Endpoints quick map
|
## API/Endpoints quick map
|
||||||
- Flask app: `server/api_server/api_server_start.py` exposes routes like `/device/<mac>`, `/devices`, `/devices/export/{csv,json}`, `/devices/import`, `/devices/totals`, `/devices/by-status`, plus `nettools`, `events`, `sessions`, `dbquery`, `metrics`, `sync`.
|
- Flask app: `server/api_server/api_server_start.py` exposes routes like `/device/<mac>`, `/devices`, `/devices/export/{csv,json}`, `/devices/import`, `/devices/totals`, `/devices/by-status`, plus `nettools`, `events`, `sessions`, `dbquery`, `metrics`, `sync`.
|
||||||
- Authorization: all routes expect header `Authorization: Bearer <API_TOKEN>` via `get_setting_value('API_TOKEN')`.
|
- Authorization: all routes expect header `Authorization: Bearer <API_TOKEN>` via `get_setting_value('API_TOKEN')`.
|
||||||
|
- All responses need to return `"success":<False:True>` and if `False` an "error" message needs to be returned, e.g. `{"success": False, "error": f"No stored open ports for Device"}`
|
||||||
|
|
||||||
## Conventions & helpers to reuse
|
## Conventions & helpers to reuse
|
||||||
- Settings: add/modify via `ccd()` in `server/initialise.py` or per‑plugin manifest. Never hardcode ports or secrets; use `get_setting_value()`.
|
- Settings: add/modify via `ccd()` in `server/initialise.py` or per‑plugin manifest. Never hardcode ports or secrets; use `get_setting_value()`.
|
||||||
- Logging: use `logger.mylog(level, [message])`; levels: none/minimal/verbose/debug/trace.
|
- Logging: use `mylog(level, [message])`; levels: none/minimal/verbose/debug/trace. `none` is used for most important messages that should always appear, such as exceptions.
|
||||||
- Time/MAC/strings: `helper.py` (`timeNowDB`, `normalize_mac`, sanitizers). Validate MACs before DB writes.
|
- Time/MAC/strings: `helper.py` (`timeNowDB`, `normalize_mac`, sanitizers). Validate MACs before DB writes.
|
||||||
- DB helpers: prefer `server/db/db_helper.py` functions (e.g., `get_table_json`, device condition helpers) over raw SQL in new paths.
|
- DB helpers: prefer `server/db/db_helper.py` functions (e.g., `get_table_json`, device condition helpers) over raw SQL in new paths.
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/docker_dev.yml
vendored
6
.github/workflows/docker_dev.yml
vendored
@@ -47,6 +47,12 @@ jobs:
|
|||||||
id: get_version
|
id: get_version
|
||||||
run: echo "version=Dev" >> $GITHUB_OUTPUT
|
run: echo "version=Dev" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# --- debug output
|
||||||
|
- name: Debug version
|
||||||
|
run: |
|
||||||
|
echo "GITHUB_REF: $GITHUB_REF"
|
||||||
|
echo "Version: '${{ steps.get_version.outputs.version }}'"
|
||||||
|
|
||||||
# --- Write the timestamped version to .VERSION file
|
# --- Write the timestamped version to .VERSION file
|
||||||
- name: Create .VERSION file
|
- name: Create .VERSION file
|
||||||
run: echo "${{ steps.timestamp.outputs.version }}" > .VERSION
|
run: echo "${{ steps.timestamp.outputs.version }}" > .VERSION
|
||||||
|
|||||||
22
.github/workflows/docker_prod.yml
vendored
22
.github/workflows/docker_prod.yml
vendored
@@ -32,14 +32,34 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
# --- Previous approach Get release version from tag
|
||||||
|
- name: Set up dynamic build ARGs
|
||||||
|
id: getargs
|
||||||
|
run: echo "version=$(cat ./stable/VERSION)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Get release version
|
||||||
|
id: get_version_prev
|
||||||
|
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
|
||||||
|
|
||||||
|
- name: Create .VERSION file
|
||||||
|
run: echo "${{ steps.get_version.outputs.version }}" >> .VERSION_PREV
|
||||||
|
|
||||||
# --- Get release version from tag
|
# --- Get release version from tag
|
||||||
- name: Get release version
|
- name: Get release version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
# --- debug output
|
||||||
|
- name: Debug version
|
||||||
|
run: |
|
||||||
|
echo "GITHUB_REF: $GITHUB_REF"
|
||||||
|
echo "Version: '${{ steps.get_version.outputs.version }}'"
|
||||||
|
echo "Version prev: '${{ steps.get_version_prev.outputs.version }}'"
|
||||||
|
|
||||||
# --- Write version to .VERSION file
|
# --- Write version to .VERSION file
|
||||||
- name: Create .VERSION file
|
- name: Create .VERSION file
|
||||||
run: echo "${{ steps.get_version.outputs.version }}" > .VERSION
|
run: echo -n "${{ steps.get_version.outputs.version }}" > .VERSION
|
||||||
|
|
||||||
# --- Generate Docker metadata and tags
|
# --- Generate Docker metadata and tags
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ nohup.out
|
|||||||
config/*
|
config/*
|
||||||
.ash_history
|
.ash_history
|
||||||
.VERSION
|
.VERSION
|
||||||
|
.VERSION_PREV
|
||||||
config/pialert.conf
|
config/pialert.conf
|
||||||
config/app.conf
|
config/app.conf
|
||||||
db/*
|
db/*
|
||||||
|
|||||||
33
Dockerfile
33
Dockerfile
@@ -26,13 +26,23 @@ ENV PATH="/opt/venv/bin:$PATH"
|
|||||||
|
|
||||||
# Install build dependencies
|
# Install build dependencies
|
||||||
COPY requirements.txt /tmp/requirements.txt
|
COPY requirements.txt /tmp/requirements.txt
|
||||||
RUN apk add --no-cache bash shadow python3 python3-dev gcc musl-dev libffi-dev openssl-dev git \
|
RUN apk add --no-cache \
|
||||||
|
bash \
|
||||||
|
shadow \
|
||||||
|
python3 \
|
||||||
|
python3-dev \
|
||||||
|
gcc \
|
||||||
|
musl-dev \
|
||||||
|
libffi-dev \
|
||||||
|
openssl-dev \
|
||||||
|
git \
|
||||||
|
rust \
|
||||||
|
cargo \
|
||||||
&& python -m venv /opt/venv
|
&& python -m venv /opt/venv
|
||||||
|
|
||||||
# Create virtual environment owned by root, but readable by everyone else. This makes it easy to copy
|
# Upgrade pip/wheel/setuptools and install Python packages
|
||||||
# into hardened stage without worrying about permissions and keeps image size small. Keeping the commands
|
RUN python -m pip install --upgrade pip setuptools wheel && \
|
||||||
# together makes for a slightly smaller image size.
|
pip install --no-cache-dir -r /tmp/requirements.txt && \
|
||||||
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
|
|
||||||
chmod -R u-rwx,g-rwx /opt
|
chmod -R u-rwx,g-rwx /opt
|
||||||
|
|
||||||
# second stage is the main runtime stage with just the minimum required to run the application
|
# second stage is the main runtime stage with just the minimum required to run the application
|
||||||
@@ -138,6 +148,7 @@ RUN install -d -o ${NETALERTX_USER} -g ${NETALERTX_GROUP} -m 700 ${READ_WRITE_FO
|
|||||||
|
|
||||||
# Copy version information into the image
|
# Copy version information into the image
|
||||||
COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION
|
COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION
|
||||||
|
COPY --chown=${NETALERTX_USER}:${NETALERTX_GROUP} .[V]ERSION ${NETALERTX_APP}/.VERSION_PREV
|
||||||
|
|
||||||
# Copy the virtualenv from the builder stage
|
# Copy the virtualenv from the builder stage
|
||||||
COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
||||||
@@ -147,12 +158,12 @@ COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
|||||||
# This is done after the copy of the venv to ensure the venv is in place
|
# This is done after the copy of the venv to ensure the venv is in place
|
||||||
# although it may be quicker to do it before the copy, it keeps the image
|
# although it may be quicker to do it before the copy, it keeps the image
|
||||||
# layers smaller to do it after.
|
# layers smaller to do it after.
|
||||||
RUN if [ -f '.VERSION' ]; then \
|
RUN for vfile in .VERSION .VERSION_PREV; do \
|
||||||
cp '.VERSION' "${NETALERTX_APP}/.VERSION"; \
|
if [ ! -f "${NETALERTX_APP}/${vfile}" ]; then \
|
||||||
else \
|
echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/${vfile}"; \
|
||||||
echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/.VERSION"; \
|
fi; \
|
||||||
fi && \
|
chown 20212:20212 "${NETALERTX_APP}/${vfile}"; \
|
||||||
chown 20212:20212 "${NETALERTX_APP}/.VERSION" && \
|
done && \
|
||||||
apk add --no-cache libcap && \
|
apk add --no-cache libcap && \
|
||||||
setcap cap_net_raw+ep /bin/busybox && \
|
setcap cap_net_raw+ep /bin/busybox && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ Get visibility of what's going on on your WIFI/LAN network and enable presence d
|
|||||||
## 🚀 Quick Start
|
## 🚀 Quick Start
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
Start NetAlertX in seconds with Docker:
|
Start NetAlertX in seconds with Docker:
|
||||||
|
|
||||||
@@ -44,8 +42,7 @@ Start NetAlertX in seconds with Docker:
|
|||||||
docker run -d \
|
docker run -d \
|
||||||
--network=host \
|
--network=host \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
-v /etc/localtime:/etc/localtime:ro \
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
@@ -53,6 +50,8 @@ docker run -d \
|
|||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: Your `/local_data_dir` should contain a `config` and `db` folder.
|
||||||
|
|
||||||
To deploy a containerized instance directly from the source repository, execute the following BASH sequence:
|
To deploy a containerized instance directly from the source repository, execute the following BASH sequence:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/jokob-sk/NetAlertX.git
|
git clone https://github.com/jokob-sk/NetAlertX.git
|
||||||
|
|||||||
24
docs/API.md
24
docs/API.md
@@ -1,4 +1,4 @@
|
|||||||
# NetAlertX API Documentation
|
# API Documentation
|
||||||
|
|
||||||
This API provides programmatic access to **devices, events, sessions, metrics, network tools, and sync** in NetAlertX. It is implemented as a **REST and GraphQL server**. All requests require authentication via **API Token** (`API_TOKEN` setting) unless explicitly noted. For example, to authorize a GraphQL request, you need to use a `Authorization: Bearer API_TOKEN` header as per example below:
|
This API provides programmatic access to **devices, events, sessions, metrics, network tools, and sync** in NetAlertX. It is implemented as a **REST and GraphQL server**. All requests require authentication via **API Token** (`API_TOKEN` setting) unless explicitly noted. For example, to authorize a GraphQL request, you need to use a `Authorization: Bearer API_TOKEN` header as per example below:
|
||||||
|
|
||||||
@@ -36,9 +36,15 @@ Authorization: Bearer <API_TOKEN>
|
|||||||
If the token is missing or invalid, the server will return:
|
If the token is missing or invalid, the server will return:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "error": "Forbidden" }
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "ERROR: Not authorized",
|
||||||
|
"error": "Forbidden"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
HTTP Status: **403 Forbidden**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Base URL
|
## Base URL
|
||||||
@@ -54,6 +60,8 @@ http://<server>:<GRAPHQL_PORT>/
|
|||||||
> [!TIP]
|
> [!TIP]
|
||||||
> When retrieving devices or settings try using the GraphQL API endpoint first as it is read-optimized.
|
> When retrieving devices or settings try using the GraphQL API endpoint first as it is read-optimized.
|
||||||
|
|
||||||
|
### Standard REST Endpoints
|
||||||
|
|
||||||
* [Device API Endpoints](API_DEVICE.md) – Manage individual devices
|
* [Device API Endpoints](API_DEVICE.md) – Manage individual devices
|
||||||
* [Devices Collection](API_DEVICES.md) – Bulk operations on multiple devices
|
* [Devices Collection](API_DEVICES.md) – Bulk operations on multiple devices
|
||||||
* [Events](API_EVENTS.md) – Device event logging and management
|
* [Events](API_EVENTS.md) – Device event logging and management
|
||||||
@@ -69,6 +77,18 @@ http://<server>:<GRAPHQL_PORT>/
|
|||||||
* [Logs](API_LOGS.md) – Purging of logs and adding to the event execution queue for user triggered events
|
* [Logs](API_LOGS.md) – Purging of logs and adding to the event execution queue for user triggered events
|
||||||
* [DB query](API_DBQUERY.md) (⚠ Internal) - Low level database access - use other endpoints if possible
|
* [DB query](API_DBQUERY.md) (⚠ Internal) - Low level database access - use other endpoints if possible
|
||||||
|
|
||||||
|
### MCP Server Bridge
|
||||||
|
|
||||||
|
NetAlertX includes an **MCP (Model Context Protocol) Server Bridge** that provides AI assistants access to NetAlertX functionality through standardized tools. MCP endpoints are available at `/mcp/sse/*` paths and mirror the functionality of standard REST endpoints:
|
||||||
|
|
||||||
|
* `/mcp/sse` - Server-Sent Events endpoint for MCP client connections
|
||||||
|
* `/mcp/sse/openapi.json` - OpenAPI specification for available MCP tools
|
||||||
|
* `/mcp/sse/device/*`, `/mcp/sse/devices/*`, `/mcp/sse/nettools/*`, `/mcp/sse/events/*` - MCP-enabled versions of REST endpoints
|
||||||
|
|
||||||
|
MCP endpoints require the same Bearer token authentication as REST endpoints.
|
||||||
|
|
||||||
|
**📖 See [MCP Server Bridge API](API_MCP.md) for complete documentation, tool specifications, and integration examples.**
|
||||||
|
|
||||||
See [Testing](API_TESTS.md) for example requests and usage.
|
See [Testing](API_TESTS.md) for example requests and usage.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -16,10 +16,14 @@ All `/dbquery/*` endpoints require an API token in the HTTP headers:
|
|||||||
Authorization: Bearer <API_TOKEN>
|
Authorization: Bearer <API_TOKEN>
|
||||||
```
|
```
|
||||||
|
|
||||||
If the token is missing or invalid:
|
If the token is missing or invalid (HTTP 403):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "error": "Forbidden" }
|
{
|
||||||
|
\"success\": false,
|
||||||
|
\"message\": \"ERROR: Not authorized\",
|
||||||
|
\"error\": \"Forbidden\"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ Manage a **single device** by its MAC address. Operations include retrieval, upd
|
|||||||
* Device not found → HTTP 404
|
* Device not found → HTTP 404
|
||||||
* Unauthorized → HTTP 403
|
* Unauthorized → HTTP 403
|
||||||
|
|
||||||
|
**MCP Integration**: Available as `get_device_info` and `set_device_alias` tools. See [MCP Server Bridge API](API_MCP.md).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2. Update Device Fields
|
## 2. Update Device Fields
|
||||||
|
|||||||
@@ -207,6 +207,93 @@ The Devices Collection API provides operations to **retrieve, manage, import/exp
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### 9. Search Devices
|
||||||
|
|
||||||
|
* **POST** `/devices/search`
|
||||||
|
Search for devices by MAC, name, or IP address.
|
||||||
|
|
||||||
|
**Request Body** (JSON):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"query": ".50"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"devName": "Test Device",
|
||||||
|
"devMac": "AA:BB:CC:DD:EE:FF",
|
||||||
|
"devLastIP": "192.168.1.50"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 10. Get Latest Device
|
||||||
|
|
||||||
|
* **GET** `/devices/latest`
|
||||||
|
Get the most recently connected device.
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"devName": "Latest Device",
|
||||||
|
"devMac": "AA:BB:CC:DD:EE:FF",
|
||||||
|
"devLastIP": "192.168.1.100",
|
||||||
|
"devFirstConnection": "2025-12-07 10:30:00"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 11. Get Network Topology
|
||||||
|
|
||||||
|
* **GET** `/devices/network/topology`
|
||||||
|
Get network topology showing device relationships.
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "AA:AA:AA:AA:AA:AA",
|
||||||
|
"name": "Router",
|
||||||
|
"vendor": "VendorA"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"source": "AA:AA:AA:AA:AA:AA",
|
||||||
|
"target": "BB:BB:BB:BB:BB:BB",
|
||||||
|
"port": "eth1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MCP Tools
|
||||||
|
|
||||||
|
These endpoints are also available as **MCP Tools** for AI assistant integration:
|
||||||
|
- `list_devices`, `search_devices`, `get_latest_device`, `get_network_topology`, `set_device_alias`
|
||||||
|
|
||||||
|
📖 See [MCP Server Bridge API](API_MCP.md) for AI integration details.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Example `curl` Requests
|
## Example `curl` Requests
|
||||||
|
|
||||||
**Get All Devices**:
|
**Get All Devices**:
|
||||||
@@ -247,3 +334,26 @@ curl -X GET "http://<server_ip>:<GRAPHQL_PORT>/devices/by-status?status=online"
|
|||||||
-H "Authorization: Bearer <API_TOKEN>"
|
-H "Authorization: Bearer <API_TOKEN>"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Search Devices**:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -X POST "http://<server_ip>:<GRAPHQL_PORT>/devices/search" \
|
||||||
|
-H "Authorization: Bearer <API_TOKEN>" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
--data '{"query": "192.168.1"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Get Latest Device**:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -X GET "http://<server_ip>:<GRAPHQL_PORT>/devices/latest" \
|
||||||
|
-H "Authorization: Bearer <API_TOKEN>"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Get Network Topology**:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -X GET "http://<server_ip>:<GRAPHQL_PORT>/devices/network/topology" \
|
||||||
|
-H "Authorization: Bearer <API_TOKEN>"
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,56 @@ The Events API provides access to **device event logs**, allowing creation, retr
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 4. Event Totals Over a Period
|
### 4. Get Recent Events
|
||||||
|
|
||||||
|
* **GET** `/events/recent` → Get events from the last 24 hours
|
||||||
|
* **GET** `/events/<hours>` → Get events from the last N hours
|
||||||
|
|
||||||
|
**Response** (JSON):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"hours": 24,
|
||||||
|
"count": 5,
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"eve_DateTime": "2025-12-07 12:00:00",
|
||||||
|
"eve_EventType": "New Device",
|
||||||
|
"eve_MAC": "AA:BB:CC:DD:EE:FF",
|
||||||
|
"eve_IP": "192.168.1.100",
|
||||||
|
"eve_AdditionalInfo": "Device detected"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 5. Get Latest Events
|
||||||
|
|
||||||
|
* **GET** `/events/last`
|
||||||
|
Get the 10 most recent events.
|
||||||
|
|
||||||
|
**Response** (JSON):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"count": 10,
|
||||||
|
"events": [
|
||||||
|
{
|
||||||
|
"eve_DateTime": "2025-12-07 12:00:00",
|
||||||
|
"eve_EventType": "Device Down",
|
||||||
|
"eve_MAC": "AA:BB:CC:DD:EE:FF"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 6. Event Totals Over a Period
|
||||||
|
|
||||||
* **GET** `/sessions/totals?period=<period>`
|
* **GET** `/sessions/totals?period=<period>`
|
||||||
Return event and session totals over a given period.
|
Return event and session totals over a given period.
|
||||||
@@ -116,12 +165,25 @@ The Events API provides access to **device event logs**, allowing creation, retr
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## MCP Tools
|
||||||
|
|
||||||
|
Event endpoints are available as **MCP Tools** for AI assistant integration:
|
||||||
|
- `get_recent_alerts`, `get_last_events`
|
||||||
|
|
||||||
|
📖 See [MCP Server Bridge API](API_MCP.md) for AI integration details.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
* All endpoints require **authorization** (Bearer token). Unauthorized requests return:
|
* All endpoints require **authorization** (Bearer token). Unauthorized requests return HTTP 403:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "error": "Forbidden" }
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "ERROR: Not authorized",
|
||||||
|
"error": "Forbidden"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* Events are stored in the **Events table** with the following fields:
|
* Events are stored in the **Events table** with the following fields:
|
||||||
|
|||||||
326
docs/API_MCP.md
Normal file
326
docs/API_MCP.md
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
# MCP Server Bridge API
|
||||||
|
|
||||||
|
The **MCP (Model Context Protocol) Server Bridge** provides AI assistants with standardized access to NetAlertX functionality through tools and server-sent events. This enables AI systems to interact with your network monitoring data in real-time.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The MCP Server Bridge exposes NetAlertX functionality as **MCP Tools** that AI assistants can call to:
|
||||||
|
|
||||||
|
- Search and retrieve device information
|
||||||
|
- Trigger network scans
|
||||||
|
- Get network topology and events
|
||||||
|
- Wake devices via Wake-on-LAN
|
||||||
|
- Access open port information
|
||||||
|
- Set device aliases
|
||||||
|
|
||||||
|
All MCP endpoints mirror the functionality of standard REST endpoints but are optimized for AI assistant integration.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Authentication
|
||||||
|
|
||||||
|
MCP endpoints use the same **Bearer token authentication** as REST endpoints:
|
||||||
|
|
||||||
|
```http
|
||||||
|
Authorization: Bearer <API_TOKEN>
|
||||||
|
```
|
||||||
|
|
||||||
|
Unauthorized requests return HTTP 403:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": false,
|
||||||
|
"message": "ERROR: Not authorized",
|
||||||
|
"error": "Forbidden"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MCP Connection Endpoint
|
||||||
|
|
||||||
|
### Server-Sent Events (SSE)
|
||||||
|
|
||||||
|
* **GET/POST** `/mcp/sse`
|
||||||
|
|
||||||
|
Main MCP connection endpoint for AI clients. Establishes a persistent connection using Server-Sent Events for real-time communication between AI assistants and NetAlertX.
|
||||||
|
|
||||||
|
**Connection Example**:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const eventSource = new EventSource('/mcp/sse', {
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer <API_TOKEN>'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
eventSource.onmessage = function(event) {
|
||||||
|
const response = JSON.parse(event.data);
|
||||||
|
console.log('MCP Response:', response);
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## OpenAPI Specification
|
||||||
|
|
||||||
|
### Get MCP Tools Specification
|
||||||
|
|
||||||
|
* **GET** `/mcp/sse/openapi.json`
|
||||||
|
|
||||||
|
Returns the OpenAPI specification for all available MCP tools, describing the parameters and schemas for each tool.
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"openapi": "3.0.0",
|
||||||
|
"info": {
|
||||||
|
"title": "NetAlertX Tools",
|
||||||
|
"version": "1.1.0"
|
||||||
|
},
|
||||||
|
"servers": [{"url": "/"}],
|
||||||
|
"paths": {
|
||||||
|
"/devices/by-status": {
|
||||||
|
"post": {"operationId": "list_devices"}
|
||||||
|
},
|
||||||
|
"/device/{mac}": {
|
||||||
|
"post": {"operationId": "get_device_info"}
|
||||||
|
},
|
||||||
|
"/devices/search": {
|
||||||
|
"post": {"operationId": "search_devices"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Available MCP Tools
|
||||||
|
|
||||||
|
### Device Management Tools
|
||||||
|
|
||||||
|
| Tool | Endpoint | Description |
|
||||||
|
|------|----------|-------------|
|
||||||
|
| `list_devices` | `/mcp/sse/devices/by-status` | List devices by online status |
|
||||||
|
| `get_device_info` | `/mcp/sse/device/<mac>` | Get detailed device information |
|
||||||
|
| `search_devices` | `/mcp/sse/devices/search` | Search devices by MAC, name, or IP |
|
||||||
|
| `get_latest_device` | `/mcp/sse/devices/latest` | Get most recently connected device |
|
||||||
|
| `set_device_alias` | `/mcp/sse/device/<mac>/set-alias` | Set device friendly name |
|
||||||
|
|
||||||
|
### Network Tools
|
||||||
|
|
||||||
|
| Tool | Endpoint | Description |
|
||||||
|
|------|----------|-------------|
|
||||||
|
| `trigger_scan` | `/mcp/sse/nettools/trigger-scan` | Trigger network discovery scan |
|
||||||
|
| `get_open_ports` | `/mcp/sse/device/open_ports` | Get stored NMAP open ports for device |
|
||||||
|
| `wol_wake_device` | `/mcp/sse/nettools/wakeonlan` | Wake device using Wake-on-LAN |
|
||||||
|
| `get_network_topology` | `/mcp/sse/devices/network/topology` | Get network topology map |
|
||||||
|
|
||||||
|
### Event & Monitoring Tools
|
||||||
|
|
||||||
|
| Tool | Endpoint | Description |
|
||||||
|
|------|----------|-------------|
|
||||||
|
| `get_recent_alerts` | `/mcp/sse/events/recent` | Get events from last 24 hours |
|
||||||
|
| `get_last_events` | `/mcp/sse/events/last` | Get 10 most recent events |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Tool Usage Examples
|
||||||
|
|
||||||
|
### Search Devices Tool
|
||||||
|
|
||||||
|
**Tool Call**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "1",
|
||||||
|
"method": "tools/call",
|
||||||
|
"params": {
|
||||||
|
"name": "search_devices",
|
||||||
|
"arguments": {
|
||||||
|
"query": "192.168.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "1",
|
||||||
|
"result": {
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "{\n \"success\": true,\n \"devices\": [\n {\n \"devName\": \"Router\",\n \"devMac\": \"AA:BB:CC:DD:EE:FF\",\n \"devLastIP\": \"192.168.1.1\"\n }\n ]\n}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isError": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Trigger Network Scan Tool
|
||||||
|
|
||||||
|
**Tool Call**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "2",
|
||||||
|
"method": "tools/call",
|
||||||
|
"params": {
|
||||||
|
"name": "trigger_scan",
|
||||||
|
"arguments": {
|
||||||
|
"type": "ARPSCAN"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "2",
|
||||||
|
"result": {
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "{\n \"success\": true,\n \"message\": \"Scan triggered for type: ARPSCAN\"\n}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isError": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Wake-on-LAN Tool
|
||||||
|
|
||||||
|
**Tool Call**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "3",
|
||||||
|
"method": "tools/call",
|
||||||
|
"params": {
|
||||||
|
"name": "wol_wake_device",
|
||||||
|
"arguments": {
|
||||||
|
"devMac": "AA:BB:CC:DD:EE:FF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Integration with AI Assistants
|
||||||
|
|
||||||
|
### Claude Desktop Integration
|
||||||
|
|
||||||
|
Add to your Claude Desktop `mcp.json` configuration:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcp": {
|
||||||
|
"servers": {
|
||||||
|
"netalertx": {
|
||||||
|
"command": "node",
|
||||||
|
"args": ["/path/to/mcp-client.js"],
|
||||||
|
"env": {
|
||||||
|
"NETALERTX_URL": "http://your-server:<GRAPHQL_PORT>",
|
||||||
|
"NETALERTX_TOKEN": "your-api-token"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generic MCP Client
|
||||||
|
|
||||||
|
```python
|
||||||
|
import asyncio
|
||||||
|
import json
|
||||||
|
from mcp import ClientSession, StdioServerParameters
|
||||||
|
from mcp.client.stdio import stdio_client
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
# Connect to NetAlertX MCP server
|
||||||
|
server_params = StdioServerParameters(
|
||||||
|
command="curl",
|
||||||
|
args=[
|
||||||
|
"-N", "-H", "Authorization: Bearer <API_TOKEN>",
|
||||||
|
"http://your-server:<GRAPHQL_PORT>/mcp/sse"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
async with stdio_client(server_params) as (read, write):
|
||||||
|
async with ClientSession(read, write) as session:
|
||||||
|
# Initialize connection
|
||||||
|
await session.initialize()
|
||||||
|
|
||||||
|
# List available tools
|
||||||
|
tools = await session.list_tools()
|
||||||
|
print(f"Available tools: {[t.name for t in tools.tools]}")
|
||||||
|
|
||||||
|
# Call a tool
|
||||||
|
result = await session.call_tool("search_devices", {"query": "router"})
|
||||||
|
print(f"Search result: {result}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(main())
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
MCP tool calls return structured error information:
|
||||||
|
|
||||||
|
**Error Response**:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "1",
|
||||||
|
"result": {
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": "Error calling tool: Device not found"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"isError": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Common Error Types**:
|
||||||
|
- `401/403` - Authentication failure
|
||||||
|
- `400` - Invalid parameters or missing required fields
|
||||||
|
- `404` - Resource not found (device, scan results, etc.)
|
||||||
|
- `500` - Internal server error
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
* MCP endpoints require the same API token authentication as REST endpoints
|
||||||
|
* All MCP tools return JSON responses wrapped in MCP protocol format
|
||||||
|
* Server-Sent Events maintain persistent connections for real-time updates
|
||||||
|
* Tool parameters match their REST endpoint equivalents
|
||||||
|
* Error responses include both HTTP status codes and descriptive messages
|
||||||
|
* MCP bridge automatically handles request/response serialization
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Related Documentation
|
||||||
|
|
||||||
|
* [Main API Overview](API.md) - Core REST API documentation
|
||||||
|
* [Device API](API_DEVICE.md) - Individual device management
|
||||||
|
* [Devices Collection API](API_DEVICES.md) - Bulk device operations
|
||||||
|
* [Network Tools API](API_NETTOOLS.md) - Wake-on-LAN, scans, network utilities
|
||||||
|
* [Events API](API_EVENTS.md) - Event logging and monitoring
|
||||||
@@ -241,3 +241,12 @@ curl -X POST "http://<server_ip>:<GRAPHQL_PORT>/nettools/nmap" \
|
|||||||
curl "http://<server_ip>:<GRAPHQL_PORT>/nettools/internetinfo" \
|
curl "http://<server_ip>:<GRAPHQL_PORT>/nettools/internetinfo" \
|
||||||
-H "Authorization: Bearer <API_TOKEN>"
|
-H "Authorization: Bearer <API_TOKEN>"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MCP Tools
|
||||||
|
|
||||||
|
Network tools are available as **MCP Tools** for AI assistant integration:
|
||||||
|
- `wol_wake_device`, `trigger_scan`, `get_open_ports`
|
||||||
|
|
||||||
|
📖 See [MCP Server Bridge API](API_MCP.md) for AI integration details.
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ Start the container via the **terminal** with a command similar to this one:
|
|||||||
docker run \
|
docker run \
|
||||||
--network=host \
|
--network=host \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
-v /etc/localtime:/etc/localtime:ro \
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
@@ -26,6 +25,8 @@ docker run \
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: Your `/local_data_dir` should contain a `config` and `db` folder.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> ⚠ The most important part is NOT to use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
|
> ⚠ The most important part is NOT to use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NetAlertX - Device Management
|
# Device Management
|
||||||
|
|
||||||
The Main Info section is where most of the device identifiable information is stored and edited. Some of the information is autodetected via various plugins. Initial values for most of the fields can be specified in the `NEWDEV` plugin.
|
The Main Info section is where most of the device identifiable information is stored and edited. Some of the information is autodetected via various plugins. Initial values for most of the fields can be specified in the `NEWDEV` plugin.
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# NetAlertX and Docker Compose
|
# NetAlertX and Docker Compose
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.
|
Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.
|
||||||
|
|
||||||
@@ -125,9 +123,9 @@ docker compose up
|
|||||||
|
|
||||||
### Modification 1: Use a Local Folder (Bind Mount)
|
### Modification 1: Use a Local Folder (Bind Mount)
|
||||||
|
|
||||||
By default, the baseline compose file uses a single named volume (netalertx_data) mounted at /data. This single-volume layout is preferred because NetAlertX manages both configuration and the database under /data (for example, /data/config and /data/db) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside /data.
|
By default, the baseline compose file uses a single named volume (netalertx_data) mounted at `/data`. This single-volume layout is preferred because NetAlertX manages both configuration and the database under `/data` (for example, `/data/config` and `/data/db`) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside `/data`.
|
||||||
|
|
||||||
A two-volume layout that mounts /data/config and /data/db separately (for example, netalertx_config and netalertx_db) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments.
|
A two-volume layout that mounts `/data/config` and `/data/db` separately (for example, `netalertx_config` and `netalertx_db`) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments.
|
||||||
|
|
||||||
However, if you prefer to have direct, file-level access to your configuration for manual editing, a "bind mount" is a simple alternative. This tells Docker to use a specific folder from your computer (the "host") inside the container.
|
However, if you prefer to have direct, file-level access to your configuration for manual editing, a "bind mount" is a simple alternative. This tells Docker to use a specific folder from your computer (the "host") inside the container.
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and scree
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d --rm --network=host \
|
docker run -d --rm --network=host \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
-v /etc/localtime:/etc/localtime \
|
-v /etc/localtime:/etc/localtime \
|
||||||
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
@@ -62,8 +61,7 @@ See alternative [docked-compose examples](https://github.com/jokob-sk/NetAlertX/
|
|||||||
|
|
||||||
| Required | Path | Description |
|
| Required | Path | Description |
|
||||||
| :------------- | :------------- | :-------------|
|
| :------------- | :------------- | :-------------|
|
||||||
| ✅ | `:/data/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files |
|
| ✅ | `:/data` | Folder which will contain the `/db/app.db`, `/config/app.conf` & `/config/devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files |
|
||||||
| ✅ | `:/data/db` | Folder which will contain the `app.db` database file |
|
|
||||||
| ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. |
|
| ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. |
|
||||||
| | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container |
|
| | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container |
|
||||||
| | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. |
|
| | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. |
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# The NetAlertX Container Operator's Guide
|
# The NetAlertX Container Operator's Guide
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
This guide assumes you are starting with the official `docker-compose.yml` file provided with the project. We strongly recommend you start with or migrate to this file as your baseline and modify it to suit your specific needs (e.g., changing file paths). While there are many ways to configure NetAlertX, the default file is designed to meet the mandatory security baseline with layer-2 networking capabilities while operating securely and without startup warnings.
|
This guide assumes you are starting with the official `docker-compose.yml` file provided with the project. We strongly recommend you start with or migrate to this file as your baseline and modify it to suit your specific needs (e.g., changing file paths). While there are many ways to configure NetAlertX, the default file is designed to meet the mandatory security baseline with layer-2 networking capabilities while operating securely and without startup warnings.
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ In the **Environment variables** section of Portainer, add the following:
|
|||||||
>
|
>
|
||||||
> `sudo chown -R 20211:20211 /local_data_dir`
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
>
|
>
|
||||||
> `sudo chmod -R a+rwx /local_data_dir1`
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ NetAlertX requires certain paths to be writable at runtime. These paths should b
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm --name netalertx --user "0" \
|
docker run -it --rm --name netalertx --user "0" \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
```
|
```
|
||||||
@@ -63,7 +62,7 @@ docker run -it --rm --name netalertx --user "0" \
|
|||||||
>
|
>
|
||||||
> `sudo chown -R 20211:20211 /local_data_dir`
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
>
|
>
|
||||||
> `sudo chmod -R a+rwx /local_data_dir1`
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
>
|
>
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -84,8 +83,7 @@ services:
|
|||||||
- NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan)
|
- NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan)
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir:/data
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
- /etc/localtime:/etc/localtime
|
- /etc/localtime:/etc/localtime
|
||||||
environment:
|
environment:
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NetAlertX Community Helper Scripts Overview
|
# Community Helper Scripts Overview
|
||||||
|
|
||||||
This page provides an overview of community-contributed scripts for NetAlertX. These scripts are not actively maintained and are provided as-is.
|
This page provides an overview of community-contributed scripts for NetAlertX. These scripts are not actively maintained and are provided as-is.
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ To download and install NetAlertX on the hardware/server directly use the `curl`
|
|||||||
> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**.
|
> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> A warning to the installation method below: Piping to bash is [controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash) and may
|
> A warning to the installation method below: Piping to bash is [controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash) and may be dangerous, as you cannot see the code that's about to be executed on your system.
|
||||||
be dangerous, as you cannot see the code that's about to be executed on your system.
|
|
||||||
|
|
||||||
If you trust this repo, you can download the install script via one of the methods (curl/wget) below and it will fo its best to install NetAlertX on your system.
|
If you trust this repo, you can download the install script via one of the methods (curl/wget) below and it will fo its best to install NetAlertX on your system.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
# Migration
|
# Migration
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
|
|
||||||
When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow the migration steps below to ensure your data and configuration are properly transferred.
|
When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow the migration steps below to ensure your data and configuration are properly transferred.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
@@ -218,7 +212,7 @@ services:
|
|||||||
|
|
||||||
### 1.3 Migration from NetAlertX `v25.10.1`
|
### 1.3 Migration from NetAlertX `v25.10.1`
|
||||||
|
|
||||||
Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md).
|
Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md). The data location has also hanged from `/app/db` and `/app/config` to `/data/db` and `/data/config`. See detailed steps below.
|
||||||
|
|
||||||
#### STEPS:
|
#### STEPS:
|
||||||
|
|
||||||
@@ -234,8 +228,8 @@ services:
|
|||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir/config:/app/config
|
||||||
- /local_data_dir/db:/data/db
|
- /local_data_dir/db:/app/db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log
|
- /local_data_dir/logs:/tmp/log
|
||||||
environment:
|
environment:
|
||||||
@@ -245,30 +239,7 @@ services:
|
|||||||
|
|
||||||
4. Start the container and verify everything works as expected.
|
4. Start the container and verify everything works as expected.
|
||||||
5. Stop the container.
|
5. Stop the container.
|
||||||
6. Perform a one-off migration to the latest `netalertx` image and `20211` user:
|
6. Update the `docker-compose.yml` as per example below.
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> The example below assumes your `/config` and `/db` folders are stored in `local_data_dir`.
|
|
||||||
> Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run -it --rm --name netalertx --user "0" \
|
|
||||||
-v /local_data_dir/config:/data/config \
|
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
..or alternatively execute:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo chown -R 20211:20211 /local_data_dir/config
|
|
||||||
sudo chown -R 20211:20211 /local_data_dir/db
|
|
||||||
sudo chmod -R a+rwx /local_data_dir/
|
|
||||||
```
|
|
||||||
|
|
||||||
7. Stop the container
|
|
||||||
8. Update the `docker-compose.yml` as per example below.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -284,10 +255,7 @@ services:
|
|||||||
- NET_BIND_SERVICE # 🆕 New line
|
- NET_BIND_SERVICE # 🆕 New line
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir:/data # 🆕 This folder contains your /db and /config directories and the parent changed from /app to /data
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
|
||||||
#- /local_data_dir/logs:/tmp/log
|
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
||||||
- /etc/localtime:/etc/localtime:ro # 🆕 New line
|
- /etc/localtime:/etc/localtime:ro # 🆕 New line
|
||||||
environment:
|
environment:
|
||||||
@@ -298,5 +266,33 @@ services:
|
|||||||
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
||||||
# 🆕 New "tmpfs" section END 🔼
|
# 🆕 New "tmpfs" section END 🔼
|
||||||
```
|
```
|
||||||
|
7. Perform a one-off migration to the latest `netalertx` image and `20211` user.
|
||||||
|
|
||||||
9. Start the container and verify everything works as expected.
|
> [!NOTE]
|
||||||
|
> The examples below assumes your `/config` and `/db` folders are stored in `local_data_dir`.
|
||||||
|
> Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup.
|
||||||
|
|
||||||
|
**Automated approach**:
|
||||||
|
|
||||||
|
Run the container with the `--user "0"` parameter. Please note, some systems will require the manual approach below.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -it --rm --name netalertx --user "0" \
|
||||||
|
-v /local_data_dir/config:/data/config \
|
||||||
|
-v /local_data_dir/db:/data/db \
|
||||||
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Stop the container and run it as you would normally.
|
||||||
|
|
||||||
|
**Manual approach**:
|
||||||
|
|
||||||
|
Use the manual approach if the Automated approach fails. Execute the below commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo chown -R 20211:20211 /local_data_dir
|
||||||
|
sudo chmod -R a+rwx /local_data_dir
|
||||||
|
```
|
||||||
|
|
||||||
|
8. Start the container and verify everything works as expected.
|
||||||
@@ -63,7 +63,6 @@ There is also an in-app Help / FAQ section that should be answering frequently a
|
|||||||
|
|
||||||
#### ♻ Misc
|
#### ♻ Misc
|
||||||
|
|
||||||
- [Version history (legacy)](./VERSIONS_HISTORY.md)
|
|
||||||
- [Reverse proxy (Nginx, Apache, SWAG)](./REVERSE_PROXY.md)
|
- [Reverse proxy (Nginx, Apache, SWAG)](./REVERSE_PROXY.md)
|
||||||
- [Installing Updates](./UPDATES.md)
|
- [Installing Updates](./UPDATES.md)
|
||||||
- [Setting up Authelia](./AUTHELIA.md) (DRAFT)
|
- [Setting up Authelia](./AUTHELIA.md) (DRAFT)
|
||||||
|
|||||||
@@ -1,62 +1,64 @@
|
|||||||
# Sessions Section in Device View
|
# Sessions Section – Device View
|
||||||
|
|
||||||
The **Sessions Section** provides details about a device's connection history. This data is automatically detected and cannot be edited by the user.
|
The **Sessions Section** shows a device’s connection history. All data is automatically detected and **cannot be edited**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Key Fields
|
## Key Fields
|
||||||
|
|
||||||
1. **Date and Time of First Connection**
|
| Field | Description | Editable? |
|
||||||
- **Description:** Displays the first detected connection time for the device.
|
| ------------------------------ | ------------------------------------------------------------------------------------------------ | --------------- |
|
||||||
- **Editability:** Uneditable (auto-detected).
|
| **First Connection** | The first time the device was detected on the network. | ❌ Auto-detected |
|
||||||
- **Source:** Automatically captured when the device is first added to the system.
|
| **Last Connection** | The most recent time the device was online. | ❌ Auto-detected |
|
||||||
|
|
||||||
2. **Date and Time of Last Connection**
|
|
||||||
- **Description:** Shows the most recent time the device was online.
|
|
||||||
- **Editability:** Uneditable (auto-detected).
|
|
||||||
- **Source:** Updated with every new connection event.
|
|
||||||
|
|
||||||
3. **Offline Devices with Missing or Conflicting Data**
|
|
||||||
- **Description:** Handles cases where a device is offline but has incomplete or conflicting session data (e.g., missing start times).
|
|
||||||
- **Handling:** The system flags these cases for review and attempts to infer missing details.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## How Sessions are Discovered and Calculated
|
## How Session Information Works
|
||||||
|
|
||||||
### 1. Detecting New Devices
|
### 1. Detecting New Devices
|
||||||
When a device is first detected in the network, the system logs it in the events table:
|
|
||||||
|
|
||||||
`INSERT INTO Events (eve_MAC, eve_IP, eve_DateTime, eve_EventType, eve_AdditionalInfo, eve_PendingAlertEmail) SELECT cur_MAC, cur_IP, '{startTime}', 'New Device', cur_Vendor, 1 FROM CurrentScan WHERE NOT EXISTS (SELECT 1 FROM Devices WHERE devMac = cur_MAC)`
|
* New devices are automatically detected when they first appear on the network.
|
||||||
|
* A **New Device** record is created, capturing the MAC, IP, vendor, and detection time.
|
||||||
|
|
||||||
- Devices scanned in the current cycle (**CurrentScan**) are checked against the **Devices** table.
|
### 2. Recording Connection Sessions
|
||||||
- If a device is new:
|
|
||||||
- A **New Device** event is logged.
|
|
||||||
- The device’s MAC, IP, vendor, and detection time are recorded.
|
|
||||||
|
|
||||||
### 2. Logging Connection Sessions
|
* Every time a device connects, a session entry is created.
|
||||||
When a new connection is detected, the system creates a session record:
|
* Captured details include:
|
||||||
|
|
||||||
`INSERT INTO Sessions (ses_MAC, ses_IP, ses_EventTypeConnection, ses_DateTimeConnection, ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_StillConnected, ses_AdditionalInfo) SELECT cur_MAC, cur_IP, 'Connected', '{startTime}', NULL, NULL, 1, cur_Vendor FROM CurrentScan WHERE NOT EXISTS (SELECT 1 FROM Sessions WHERE ses_MAC = cur_MAC)`
|
* Connection type (wired or wireless)
|
||||||
|
* Connection time
|
||||||
- A new session is logged in the **Sessions** table if no prior session exists.
|
* Device details (MAC, IP, vendor)
|
||||||
- Fields like `MAC`, `IP`, `Connection Type`, and `Connection Time` are populated.
|
|
||||||
- The `Still Connected` flag is set to `1` (active connection).
|
|
||||||
|
|
||||||
### 3. Handling Missing or Conflicting Data
|
### 3. Handling Missing or Conflicting Data
|
||||||
- Devices with incomplete or conflicting session data (e.g., missing start times) are detected.
|
|
||||||
- The system flags these records and attempts corrections by inferring details from available data.
|
* **Triggers:**
|
||||||
|
Devices are flagged when session data is incomplete, inconsistent, or conflicting. Examples include:
|
||||||
|
|
||||||
|
* Missing first or last connection timestamps
|
||||||
|
* Overlapping session records
|
||||||
|
* Sessions showing a device as connected and disconnected at the same time
|
||||||
|
|
||||||
|
* **System response:**
|
||||||
|
|
||||||
|
* Automatically highlights affected devices in the **Sessions Section**.
|
||||||
|
* Attempts to **infer missing information** from available data, such as:
|
||||||
|
|
||||||
|
* Estimating first or last connection times from nearby session events
|
||||||
|
* Correcting overlapping session periods
|
||||||
|
* Reconciling conflicting connection statuses
|
||||||
|
|
||||||
|
* **User impact:**
|
||||||
|
|
||||||
|
* Users do **not** need to manually fix session data.
|
||||||
|
* The system ensures the device’s connection history remains as accurate as possible for monitoring and reporting.
|
||||||
|
|
||||||
### 4. Updating Sessions
|
### 4. Updating Sessions
|
||||||
- When a device reconnects, its session is updated with a new connection timestamp.
|
|
||||||
- When a device disconnects:
|
|
||||||
- The **Disconnection Time** is recorded.
|
|
||||||
- The `Still Connected` flag is set to `0`.
|
|
||||||
|
|
||||||
The session information is then used to display the device presence under **Monitoring** -> **Presence**.
|
* **Reconnect:** Updates session with the new connection timestamp.
|
||||||
|
* **Disconnect:** Records disconnection time and marks the device as offline.
|
||||||
|
|
||||||
|
This session information feeds directly into **Monitoring → Presence**, providing a live view of which devices are currently online.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ services:
|
|||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
- NET_BIND_SERVICE
|
- NET_BIND_SERVICE
|
||||||
volumes:
|
volumes:
|
||||||
- /app_storage/netalertx/config:/data/config
|
- /app_storage/netalertx:/data
|
||||||
- /app_storage/netalertx/db:/data/db
|
|
||||||
# to sync with system time
|
# to sync with system time
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
tmpfs:
|
tmpfs:
|
||||||
@@ -66,10 +65,7 @@ services:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
- /volume1/app_storage/netalertx/config:/data/config
|
- /volume1/app_storage/netalertx:/data
|
||||||
- /volume1/app_storage/netalertx/db:/data/db
|
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
|
||||||
# - local/path/logs:/tmp/log <- commented out with # ⚠
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@@ -88,5 +84,5 @@ services:
|
|||||||
>
|
>
|
||||||
> `sudo chown -R 20211:20211 /local_data_dir`
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
>
|
>
|
||||||
> `sudo chmod -R a+rwx /local_data_dir1`
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> For versions prior to `v25.6.7` upgrade to version `v25.5.24` first (`docker pull ghcr.io/jokob-sk/netalertx:25.5.24`) as later versions don't support a full upgrade. Alternatively, devices and settings can be migrated manually, e.g. via [CSV import](./DEVICES_BULK_EDITING.md).
|
> For versions prior to `v25.6.7` upgrade to version `v25.5.24` first (`docker pull ghcr.io/jokob-sk/netalertx:25.5.24`) as later versions don't support a full upgrade. Alternatively, devices and settings can be migrated manually, e.g. via [CSV import](./DEVICES_BULK_EDITING.md).
|
||||||
|
> See the [Migration guide](./MIGRATION.md) for details.
|
||||||
|
|
||||||
This guide outlines approaches for updating Docker containers, usually when upgrading to a newer version of NetAlertX. Each method offers different benefits depending on the situation. Here are the methods:
|
This guide outlines approaches for updating Docker containers, usually when upgrading to a newer version of NetAlertX. Each method offers different benefits depending on the situation. Here are the methods:
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ a[target="_blank"] {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-is-valid="0"] {
|
||||||
|
/* border: 1px solid red; */
|
||||||
|
background-color: #ff4b4b !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Helper Classes
|
Helper Classes
|
||||||
----------------------------------------------------------------------------- */
|
----------------------------------------------------------------------------- */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
#---------------------------------------------------------------------------------#
|
#---------------------------------------------------------------------------------#
|
||||||
# NetAlertX #
|
# NetAlertX #
|
||||||
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
||||||
# #
|
# #
|
||||||
# devices.php - Front module. Devices list page #
|
# devices.php - Front module. Devices list page #
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<!-- page script ----------------------------------------------------------- -->
|
<!-- page script ----------------------------------------------------------- -->
|
||||||
<script>
|
<script>
|
||||||
var deviceStatus = 'all';
|
var deviceStatus = 'all';
|
||||||
var tableRows = getCache ("nax_parTableRows") == "" ? parseInt(getSetting("UI_DEFAULT_PAGE_SIZE")) : getCache ("nax_parTableRows") ;
|
|
||||||
var tableOrder = getCache ("nax_parTableOrder") == "" ? [[3,'desc'], [0,'asc']] : JSON.parse(getCache ("nax_parTableOrder")) ;
|
var tableOrder = getCache ("nax_parTableOrder") == "" ? [[3,'desc'], [0,'asc']] : JSON.parse(getCache ("nax_parTableOrder")) ;
|
||||||
|
|
||||||
var tableColumnHide = [];
|
var tableColumnHide = [];
|
||||||
@@ -563,6 +563,9 @@ function initializeDatatable (status) {
|
|||||||
status = 'my_devices'
|
status = 'my_devices'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// retrieve page size
|
||||||
|
var tableRows = getCache ("nax_parTableRows") == "" ? parseInt(getSetting("UI_DEFAULT_PAGE_SIZE")) : getCache ("nax_parTableRows") ;
|
||||||
|
|
||||||
// Save status selected
|
// Save status selected
|
||||||
deviceStatus = status;
|
deviceStatus = status;
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ function localizeTimestamp(input) {
|
|||||||
let tz = getSetting("TIMEZONE") || 'Europe/Berlin';
|
let tz = getSetting("TIMEZONE") || 'Europe/Berlin';
|
||||||
input = String(input || '').trim();
|
input = String(input || '').trim();
|
||||||
|
|
||||||
// ✅ 1. Unix timestamps (10 or 13 digits)
|
// 1. Unix timestamps (10 or 13 digits)
|
||||||
if (/^\d+$/.test(input)) {
|
if (/^\d+$/.test(input)) {
|
||||||
const ms = input.length === 10 ? parseInt(input, 10) * 1000 : parseInt(input, 10);
|
const ms = input.length === 10 ? parseInt(input, 10) * 1000 : parseInt(input, 10);
|
||||||
return new Intl.DateTimeFormat('default', {
|
return new Intl.DateTimeFormat('default', {
|
||||||
@@ -389,39 +389,59 @@ function localizeTimestamp(input) {
|
|||||||
}).format(new Date(ms));
|
}).format(new Date(ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 2. European DD/MM/YYYY
|
// 2. European DD/MM/YYYY
|
||||||
let match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ ,]+(\d{1,2}:\d{2}(?::\d{2})?))?(.*)$/);
|
let match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ ,]+(\d{1,2}:\d{2}(?::\d{2})?))?$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
let [ , d, m, y, t = "00:00:00", tzPart = "" ] = match;
|
let [, d, m, y, t = "00:00:00", tzPart = ""] = match;
|
||||||
const iso = `${y}-${m.padStart(2,'0')}-${d.padStart(2,'0')}T${t.length===5?t+":00":t}${tzPart}`;
|
const dNum = parseInt(d, 10);
|
||||||
return formatSafe(iso, tz);
|
const mNum = parseInt(m, 10);
|
||||||
|
|
||||||
|
if (dNum <= 12 && mNum > 12) {
|
||||||
|
} else {
|
||||||
|
const iso = `${y}-${m.padStart(2,'0')}-${d.padStart(2,'0')}T${t.length===5 ? t + ":00" : t}${tzPart}`;
|
||||||
|
return formatSafe(iso, tz);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 3. US MM/DD/YYYY
|
// 3. US MM/DD/YYYY
|
||||||
match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ ,]+(\d{1,2}:\d{2}(?::\d{2})?))?(.*)$/);
|
match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ ,]+(\d{1,2}:\d{2}(?::\d{2})?))?(.*)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
let [ , m, d, y, t = "00:00:00", tzPart = "" ] = match;
|
let [, m, d, y, t = "00:00:00", tzPart = ""] = match;
|
||||||
const iso = `${y}-${m.padStart(2,'0')}-${d.padStart(2,'0')}T${t.length===5?t+":00":t}${tzPart}`;
|
const iso = `${y}-${m.padStart(2,'0')}-${d.padStart(2,'0')}T${t.length===5?t+":00":t}${tzPart}`;
|
||||||
return formatSafe(iso, tz);
|
return formatSafe(iso, tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 4. ISO-style (with T, Z, offsets)
|
// 4. ISO YYYY-MM-DD with optional Z/+offset
|
||||||
match = input.match(/^(\d{4}-\d{1,2}-\d{1,2})[ T](\d{1,2}:\d{2}(?::\d{2})?)(Z|[+-]\d{2}:?\d{2})?$/);
|
match = input.match(/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])[ T](\d{1,2}:\d{2}(?::\d{2})?)(Z|[+-]\d{2}:?\d{2})?$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
let [ , ymd, time, offset = "" ] = match;
|
let [, y, m, d, time, offset = ""] = match;
|
||||||
// normalize to YYYY-MM-DD
|
|
||||||
let [y, m, d] = ymd.split('-').map(x => x.padStart(2,'0'));
|
|
||||||
const iso = `${y}-${m}-${d}T${time.length===5?time+":00":time}${offset}`;
|
const iso = `${y}-${m}-${d}T${time.length===5?time+":00":time}${offset}`;
|
||||||
return formatSafe(iso, tz);
|
return formatSafe(iso, tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 5. RFC2822 / "25 Aug 2025 13:45:22 +0200"
|
// 5. RFC2822 / "25 Aug 2025 13:45:22 +0200"
|
||||||
match = input.match(/^\d{1,2} [A-Za-z]{3,} \d{4}/);
|
match = input.match(/^\d{1,2} [A-Za-z]{3,} \d{4}/);
|
||||||
if (match) {
|
if (match) {
|
||||||
return formatSafe(input, tz);
|
return formatSafe(input, tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 6. Fallback (whatever Date() can parse)
|
// 6. DD-MM-YYYY with optional time
|
||||||
|
match = input.match(/^(\d{1,2})-(\d{1,2})-(\d{4})(?:[ T](\d{1,2}:\d{2}(?::\d{2})?))?$/);
|
||||||
|
if (match) {
|
||||||
|
let [, d, m, y, time = "00:00:00"] = match;
|
||||||
|
const iso = `${y}-${m.padStart(2,'0')}-${d.padStart(2,'0')}T${time.length===5?time+":00":time}`;
|
||||||
|
return formatSafe(iso, tz);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. Strict YYYY-DD-MM with optional time
|
||||||
|
match = input.match(/^(\d{4})-(0[1-9]|[12]\d|3[01])-(0[1-9]|1[0-2])(?:[ T](\d{1,2}:\d{2}(?::\d{2})?))?$/);
|
||||||
|
if (match) {
|
||||||
|
let [, y, d, m, time = "00:00:00"] = match;
|
||||||
|
const iso = `${y}-${m}-${d}T${time.length === 5 ? time + ":00" : time}`;
|
||||||
|
return formatSafe(iso, tz);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 8. Fallback
|
||||||
return formatSafe(input, tz);
|
return formatSafe(input, tz);
|
||||||
|
|
||||||
function formatSafe(str, tz) {
|
function formatSafe(str, tz) {
|
||||||
@@ -440,6 +460,7 @@ function localizeTimestamp(input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------
|
// ----------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Replaces double quotes within single-quoted strings, then converts all single quotes to double quotes,
|
* Replaces double quotes within single-quoted strings, then converts all single quotes to double quotes,
|
||||||
@@ -1622,7 +1643,6 @@ async function executeOnce() {
|
|||||||
|
|
||||||
if (!isAppInitialized()) {
|
if (!isAppInitialized()) {
|
||||||
try {
|
try {
|
||||||
console.log("HERE");
|
|
||||||
|
|
||||||
await waitForGraphQLServer(); // Wait for the server to start
|
await waitForGraphQLServer(); // Wait for the server to start
|
||||||
|
|
||||||
@@ -1630,7 +1650,7 @@ async function executeOnce() {
|
|||||||
await cacheSettings();
|
await cacheSettings();
|
||||||
await cacheStrings();
|
await cacheStrings();
|
||||||
|
|
||||||
console.log("✅ All AJAX callbacks have completed");
|
console.log("All AJAX callbacks have completed");
|
||||||
onAllCallsComplete();
|
onAllCallsComplete();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error:", error);
|
console.error("Error:", error);
|
||||||
|
|||||||
@@ -247,12 +247,19 @@ function showModalPopupForm(
|
|||||||
let settingsArray = [];
|
let settingsArray = [];
|
||||||
if (Array.isArray(popupFormJson)) {
|
if (Array.isArray(popupFormJson)) {
|
||||||
popupFormJson.forEach(field => {
|
popupFormJson.forEach(field => {
|
||||||
collectSetting(
|
const result = collectSetting(
|
||||||
`${parentSettingKey}_popupform`, // prefix
|
`${parentSettingKey}_popupform`, // prefix
|
||||||
field.function, // setCodeName
|
field.function, // setCodeName
|
||||||
field.type, // setType (object)
|
field.type, // setType (object)
|
||||||
settingsArray
|
settingsArray
|
||||||
);
|
);
|
||||||
|
settingsArray = result.settingsArray;
|
||||||
|
|
||||||
|
if (!result.dataIsValid) {
|
||||||
|
msg = getString("Gen_Invalid_Value") + ":" + result.failedSettingKey;
|
||||||
|
console.error(msg);
|
||||||
|
showModalOk("ERROR", msg);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -779,6 +779,7 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
let getStringKey = "";
|
let getStringKey = "";
|
||||||
let onClick = "console.log('onClick - Not implemented');";
|
let onClick = "console.log('onClick - Not implemented');";
|
||||||
let onChange = "console.log('onChange - Not implemented');";
|
let onChange = "console.log('onChange - Not implemented');";
|
||||||
|
let focusout = "console.log('focusout - Not implemented');";
|
||||||
let customParams = "";
|
let customParams = "";
|
||||||
let customId = "";
|
let customId = "";
|
||||||
let columns = [];
|
let columns = [];
|
||||||
@@ -830,6 +831,9 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
if (option.onChange) {
|
if (option.onChange) {
|
||||||
onChange = option.onChange;
|
onChange = option.onChange;
|
||||||
}
|
}
|
||||||
|
if (option.focusout) {
|
||||||
|
focusout = option.focusout;
|
||||||
|
}
|
||||||
if (option.customParams) {
|
if (option.customParams) {
|
||||||
customParams = option.customParams;
|
customParams = option.customParams;
|
||||||
}
|
}
|
||||||
@@ -867,7 +871,8 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1015,6 +1020,20 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
|
|
||||||
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
||||||
|
|
||||||
|
// Check if validation failed
|
||||||
|
if (
|
||||||
|
$(`#${setCodeName}`)
|
||||||
|
&& $(`#${setCodeName}`).attr("data-is-valid")
|
||||||
|
&& $(`#${setCodeName}`).attr("data-is-valid") == 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"settingsArray": settingsArray,
|
||||||
|
"dataIsValid": false,
|
||||||
|
"failedSettingKey": setCodeName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const opts = handleElementOptions('none', elementOptions, transformers, val = "");
|
const opts = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
// Map of handlers
|
// Map of handlers
|
||||||
@@ -1084,7 +1103,11 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
const value = handlers[handlerKey]();
|
const value = handlers[handlerKey]();
|
||||||
settingsArray.push([prefix, setCodeName, dataType, value]);
|
settingsArray.push([prefix, setCodeName, dataType, value]);
|
||||||
|
|
||||||
return settingsArray;
|
return {
|
||||||
|
"settingsArray": settingsArray,
|
||||||
|
"dataIsValid": true,
|
||||||
|
"failedSettingKey": ""
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1137,7 +1160,8 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
||||||
|
|
||||||
// Override value
|
// Override value
|
||||||
@@ -1160,6 +1184,7 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
||||||
|
|
||||||
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
||||||
|
onfocusout="${focusout}"
|
||||||
my-data-type="${dataType}"
|
my-data-type="${dataType}"
|
||||||
my-editable="${editable}"
|
my-editable="${editable}"
|
||||||
class="form-control ${addCss} ${cssClasses}"
|
class="form-control ${addCss} ${cssClasses}"
|
||||||
@@ -1185,6 +1210,7 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
inputHtml += `<input
|
inputHtml += `<input
|
||||||
class="${inputClass} ${cssClasses}"
|
class="${inputClass} ${cssClasses}"
|
||||||
onChange="settingsChanged();${onChange}"
|
onChange="settingsChanged();${onChange}"
|
||||||
|
onfocusout="${focusout}"
|
||||||
my-data-type="${dataType}"
|
my-data-type="${dataType}"
|
||||||
my-customparams="${customParams}"
|
my-customparams="${customParams}"
|
||||||
my-customid="${customId}"
|
my-customid="${customId}"
|
||||||
@@ -1216,6 +1242,8 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
case 'textarea':
|
case 'textarea':
|
||||||
inputHtml += `<textarea
|
inputHtml += `<textarea
|
||||||
class="form-control input"
|
class="form-control input"
|
||||||
|
onChange="settingsChanged();${onChange}"
|
||||||
|
onfocusout="${focusout}"
|
||||||
my-customparams="${customParams}"
|
my-customparams="${customParams}"
|
||||||
my-customid="${customId}"
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
|
|||||||
@@ -140,8 +140,11 @@ function validateRegex(elem) {
|
|||||||
// Validate against regex
|
// Validate against regex
|
||||||
if (regex.test(value)) {
|
if (regex.test(value)) {
|
||||||
iconSpan.html("<i class='fa fa-check'></i>");
|
iconSpan.html("<i class='fa fa-check'></i>");
|
||||||
|
inputElem.attr("data-is-valid", "1");
|
||||||
} else {
|
} else {
|
||||||
iconSpan.html("<i class='fa fa-xmark'></i>");
|
iconSpan.html("<i class='fa fa-xmark'></i>");
|
||||||
|
showModalOk('WARNING', getString("Gen_Invalid_Value"));
|
||||||
|
inputElem.attr("data-is-valid", "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,8 @@
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
// render based on element type
|
// render based on element type
|
||||||
|
|||||||
@@ -521,13 +521,17 @@ function getChildren(node, list, path, visited = [])
|
|||||||
|
|
||||||
// Loop through all items to find children of the current node
|
// Loop through all items to find children of the current node
|
||||||
for (var i in list) {
|
for (var i in list) {
|
||||||
if (list[i].devParentMAC.toLowerCase() == node.devMac.toLowerCase() && !hiddenMacs.includes(list[i].devParentMAC)) {
|
const item = list[i];
|
||||||
|
const parentMac = item.devParentMAC || ""; // null-safe
|
||||||
|
const nodeMac = node.devMac || ""; // null-safe
|
||||||
|
|
||||||
visibleNodesCount++;
|
if (parentMac != "" && parentMac.toLowerCase() == nodeMac.toLowerCase() && !hiddenMacs.includes(parentMac)) {
|
||||||
|
|
||||||
// Process children recursively, passing a copy of the visited list
|
visibleNodesCount++;
|
||||||
children.push(getChildren(list[i], list, path + ((path == "") ? "" : '|') + list[i].devParentMAC, visited));
|
|
||||||
}
|
// Process children recursively, passing a copy of the visited list
|
||||||
|
children.push(getChildren(list[i], list, path + ((path == "") ? "" : '|') + parentMac, visited));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track leaf and parent node counts
|
// Track leaf and parent node counts
|
||||||
@@ -565,14 +569,27 @@ function getChildren(node, list, path, visited = [])
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function getHierarchy()
|
function getHierarchy()
|
||||||
{
|
{
|
||||||
|
let internetNode = null;
|
||||||
|
|
||||||
for(i in deviceListGlobal)
|
for(i in deviceListGlobal)
|
||||||
{
|
{
|
||||||
if(deviceListGlobal[i].devMac == 'Internet')
|
if(deviceListGlobal[i].devMac == 'Internet')
|
||||||
{
|
{
|
||||||
return (getChildren(deviceListGlobal[i], deviceListGlobal, ''))
|
internetNode = deviceListGlobal[i];
|
||||||
|
|
||||||
|
return (getChildren(internetNode, deviceListGlobal, ''))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!internetNode) {
|
||||||
|
showModalOk(
|
||||||
|
getString('Network_Configuration_Error'),
|
||||||
|
getString('Network_Root_Not_Configured')
|
||||||
|
);
|
||||||
|
console.error("getHierarchy(): Internet node not found");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -671,8 +688,6 @@ function handleNodeClick(el)
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
var myTree;
|
var myTree;
|
||||||
|
|
||||||
|
|
||||||
var emSize;
|
var emSize;
|
||||||
var nodeHeight;
|
var nodeHeight;
|
||||||
// var sizeCoefficient = 1.4
|
// var sizeCoefficient = 1.4
|
||||||
@@ -689,140 +704,139 @@ function emToPx(em, element) {
|
|||||||
|
|
||||||
function initTree(myHierarchy)
|
function initTree(myHierarchy)
|
||||||
{
|
{
|
||||||
// calculate the drawing area based on teh tree width and available screen size
|
if(myHierarchy && myHierarchy.type !== "")
|
||||||
|
|
||||||
let baseFontSize = parseFloat($('html').css('font-size'));
|
|
||||||
let treeAreaHeight = ($(window).height() - 155); ;
|
|
||||||
// calculate the font size of the leaf nodes to fit everything into the tree area
|
|
||||||
leafNodesCount == 0 ? 1 : leafNodesCount;
|
|
||||||
|
|
||||||
emSize = pxToEm((treeAreaHeight/(leafNodesCount)).toFixed(2));
|
|
||||||
|
|
||||||
let screenWidthEm = pxToEm($('.networkTable').width()-15);
|
|
||||||
|
|
||||||
// init the drawing area size
|
|
||||||
$("#networkTree").attr('style', `height:${treeAreaHeight}px; width:${emToPx(screenWidthEm)}px`)
|
|
||||||
|
|
||||||
if(myHierarchy.type == "")
|
|
||||||
{
|
{
|
||||||
showModalOk(getString('Network_Configuration_Error'), getString('Network_Root_Not_Configured'))
|
// calculate the drawing area based on the tree width and available screen size
|
||||||
|
let baseFontSize = parseFloat($('html').css('font-size'));
|
||||||
|
let treeAreaHeight = ($(window).height() - 155); ;
|
||||||
|
|
||||||
return;
|
// calculate the font size of the leaf nodes to fit everything into the tree area
|
||||||
}
|
leafNodesCount == 0 ? 1 : leafNodesCount;
|
||||||
|
|
||||||
// handle canvas and node size if only a few nodes
|
emSize = pxToEm((treeAreaHeight/(leafNodesCount)).toFixed(2));
|
||||||
emSize > 1 ? emSize = 1 : emSize = emSize;
|
|
||||||
|
|
||||||
let nodeHeightPx = emToPx(emSize*1);
|
let screenWidthEm = pxToEm($('.networkTable').width()-15);
|
||||||
let nodeWidthPx = emToPx(screenWidthEm / (parentNodesCount));
|
|
||||||
|
|
||||||
// handle if only a few nodes
|
// init the drawing area size
|
||||||
nodeWidthPx > 160 ? nodeWidthPx = 160 : nodeWidthPx = nodeWidthPx;
|
$("#networkTree").attr('style', `height:${treeAreaHeight}px; width:${emToPx(screenWidthEm)}px`)
|
||||||
|
|
||||||
console.log(Treeviz);
|
// handle canvas and node size if only a few nodes
|
||||||
|
emSize > 1 ? emSize = 1 : emSize = emSize;
|
||||||
|
|
||||||
myTree = Treeviz.create({
|
let nodeHeightPx = emToPx(emSize*1);
|
||||||
htmlId: "networkTree",
|
let nodeWidthPx = emToPx(screenWidthEm / (parentNodesCount));
|
||||||
renderNode: nodeData => {
|
|
||||||
|
|
||||||
(!emptyArr.includes(nodeData.data.port )) ? port = nodeData.data.port : port = "";
|
// handle if only a few nodes
|
||||||
|
nodeWidthPx > 160 ? nodeWidthPx = 160 : nodeWidthPx = nodeWidthPx;
|
||||||
|
|
||||||
(port == "" || port == 0 || port == 'None' ) ? portBckgIcon = `<i class="fa fa-wifi"></i>` : portBckgIcon = `<i class="fa fa-ethernet"></i>`;
|
console.log(Treeviz);
|
||||||
|
|
||||||
portHtml = (port == "" || port == 0 || port == 'None' ) ? "   " : port;
|
myTree = Treeviz.create({
|
||||||
|
htmlId: "networkTree",
|
||||||
|
renderNode: nodeData => {
|
||||||
|
|
||||||
// Build HTML for individual nodes in the network diagram
|
(!emptyArr.includes(nodeData.data.port )) ? port = nodeData.data.port : port = "";
|
||||||
deviceIcon = (!emptyArr.includes(nodeData.data.icon )) ?
|
|
||||||
`<div class="netIcon">
|
|
||||||
${atob(nodeData.data.icon)}
|
|
||||||
</div>` : "";
|
|
||||||
devicePort = `<div class="netPort"
|
|
||||||
style="width:${emSize}em;height:${emSize}em">
|
|
||||||
${portHtml}</div>
|
|
||||||
<div class="portBckgIcon"
|
|
||||||
style="margin-left:-${emSize*0.7}em;">
|
|
||||||
${portBckgIcon}
|
|
||||||
</div>`;
|
|
||||||
collapseExpandIcon = nodeData.data.hiddenChildren ?
|
|
||||||
"square-plus" : "square-minus";
|
|
||||||
|
|
||||||
// generate +/- icon if node has children nodes
|
(port == "" || port == 0 || port == 'None' ) ? portBckgIcon = `<i class="fa fa-wifi"></i>` : portBckgIcon = `<i class="fa fa-ethernet"></i>`;
|
||||||
collapseExpandHtml = nodeData.data.hasChildren ?
|
|
||||||
`<div class="netCollapse"
|
|
||||||
style="font-size:${nodeHeightPx/2}px;top:${Math.floor(nodeHeightPx / 4)}px"
|
|
||||||
data-mytreepath="${nodeData.data.path}"
|
|
||||||
data-mytreemac="${nodeData.data.mac}">
|
|
||||||
<i class="fa fa-${collapseExpandIcon} pointer"></i>
|
|
||||||
</div>` : "";
|
|
||||||
|
|
||||||
selectedNodeMac = $(".nav-tabs-custom .active a").attr('data-mytabmac')
|
portHtml = (port == "" || port == 0 || port == 'None' ) ? "   " : port;
|
||||||
|
|
||||||
highlightedCss = nodeData.data.mac == selectedNodeMac ?
|
// Build HTML for individual nodes in the network diagram
|
||||||
" highlightedNode " : "";
|
deviceIcon = (!emptyArr.includes(nodeData.data.icon )) ?
|
||||||
cssNodeType = nodeData.data.devIsNetworkNodeDynamic ?
|
`<div class="netIcon">
|
||||||
" node-network-device " : " node-standard-device ";
|
${atob(nodeData.data.icon)}
|
||||||
|
</div>` : "";
|
||||||
|
devicePort = `<div class="netPort"
|
||||||
|
style="width:${emSize}em;height:${emSize}em">
|
||||||
|
${portHtml}</div>
|
||||||
|
<div class="portBckgIcon"
|
||||||
|
style="margin-left:-${emSize*0.7}em;">
|
||||||
|
${portBckgIcon}
|
||||||
|
</div>`;
|
||||||
|
collapseExpandIcon = nodeData.data.hiddenChildren ?
|
||||||
|
"square-plus" : "square-minus";
|
||||||
|
|
||||||
networkHardwareIcon = nodeData.data.devIsNetworkNodeDynamic ? `<span class="network-hw-icon">
|
// generate +/- icon if node has children nodes
|
||||||
<i class="fa-solid fa-hard-drive"></i>
|
collapseExpandHtml = nodeData.data.hasChildren ?
|
||||||
</span>` : "";
|
`<div class="netCollapse"
|
||||||
|
style="font-size:${nodeHeightPx/2}px;top:${Math.floor(nodeHeightPx / 4)}px"
|
||||||
|
data-mytreepath="${nodeData.data.path}"
|
||||||
|
data-mytreemac="${nodeData.data.mac}">
|
||||||
|
<i class="fa fa-${collapseExpandIcon} pointer"></i>
|
||||||
|
</div>` : "";
|
||||||
|
|
||||||
const badgeConf = getStatusBadgeParts(nodeData.data.presentLastScan, nodeData.data.alertDown, nodeData.data.mac, statusText = '')
|
selectedNodeMac = $(".nav-tabs-custom .active a").attr('data-mytabmac')
|
||||||
|
|
||||||
return result = `<div
|
highlightedCss = nodeData.data.mac == selectedNodeMac ?
|
||||||
class="node-inner hover-node-info box pointer ${highlightedCss} ${cssNodeType}"
|
" highlightedNode " : "";
|
||||||
style="height:${nodeHeightPx}px;font-size:${nodeHeightPx-5}px;"
|
cssNodeType = nodeData.data.devIsNetworkNodeDynamic ?
|
||||||
onclick="handleNodeClick(this)"
|
" node-network-device " : " node-standard-device ";
|
||||||
data-mac="${nodeData.data.mac}"
|
|
||||||
data-parentMac="${nodeData.data.parentMac}"
|
networkHardwareIcon = nodeData.data.devIsNetworkNodeDynamic ? `<span class="network-hw-icon">
|
||||||
data-name="${nodeData.data.name}"
|
<i class="fa-solid fa-hard-drive"></i>
|
||||||
data-ip="${nodeData.data.ip}"
|
</span>` : "";
|
||||||
data-mac="${nodeData.data.mac}"
|
|
||||||
data-vendor="${nodeData.data.vendor}"
|
const badgeConf = getStatusBadgeParts(nodeData.data.presentLastScan, nodeData.data.alertDown, nodeData.data.mac, statusText = '')
|
||||||
data-type="${nodeData.data.type}"
|
|
||||||
data-devIsNetworkNodeDynamic="${nodeData.data.devIsNetworkNodeDynamic}"
|
return result = `<div
|
||||||
data-lastseen="${nodeData.data.lastseen}"
|
class="node-inner hover-node-info box pointer ${highlightedCss} ${cssNodeType}"
|
||||||
data-firstseen="${nodeData.data.firstseen}"
|
style="height:${nodeHeightPx}px;font-size:${nodeHeightPx-5}px;"
|
||||||
data-relationship="${nodeData.data.relType}"
|
onclick="handleNodeClick(this)"
|
||||||
data-status="${nodeData.data.status}"
|
data-mac="${nodeData.data.mac}"
|
||||||
data-present="${nodeData.data.presentLastScan}"
|
data-parentMac="${nodeData.data.parentMac}"
|
||||||
data-alert="${nodeData.data.alertDown}"
|
data-name="${nodeData.data.name}"
|
||||||
data-icon="${nodeData.data.icon}"
|
data-ip="${nodeData.data.ip}"
|
||||||
>
|
data-mac="${nodeData.data.mac}"
|
||||||
<div class="netNodeText">
|
data-vendor="${nodeData.data.vendor}"
|
||||||
<strong><span>${devicePort} <span class="${badgeConf.cssText}">${deviceIcon}</span></span>
|
data-type="${nodeData.data.type}"
|
||||||
<span class="spanNetworkTree anonymizeDev" style="width:${nodeWidthPx-50}px">${nodeData.data.name}</span>
|
data-devIsNetworkNodeDynamic="${nodeData.data.devIsNetworkNodeDynamic}"
|
||||||
${networkHardwareIcon}
|
data-lastseen="${nodeData.data.lastseen}"
|
||||||
</strong>
|
data-firstseen="${nodeData.data.firstseen}"
|
||||||
|
data-relationship="${nodeData.data.relType}"
|
||||||
|
data-status="${nodeData.data.status}"
|
||||||
|
data-present="${nodeData.data.presentLastScan}"
|
||||||
|
data-alert="${nodeData.data.alertDown}"
|
||||||
|
data-icon="${nodeData.data.icon}"
|
||||||
|
>
|
||||||
|
<div class="netNodeText">
|
||||||
|
<strong><span>${devicePort} <span class="${badgeConf.cssText}">${deviceIcon}</span></span>
|
||||||
|
<span class="spanNetworkTree anonymizeDev" style="width:${nodeWidthPx-50}px">${nodeData.data.name}</span>
|
||||||
|
${networkHardwareIcon}
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
${collapseExpandHtml}`;
|
||||||
${collapseExpandHtml}`;
|
},
|
||||||
},
|
mainAxisNodeSpacing: 'auto',
|
||||||
mainAxisNodeSpacing: 'auto',
|
// secondaryAxisNodeSpacing: 0.3,
|
||||||
// secondaryAxisNodeSpacing: 0.3,
|
nodeHeight: nodeHeightPx,
|
||||||
nodeHeight: nodeHeightPx,
|
nodeWidth: nodeWidthPx,
|
||||||
nodeWidth: nodeWidthPx,
|
marginTop: '5',
|
||||||
marginTop: '5',
|
isHorizontal : true,
|
||||||
isHorizontal : true,
|
hasZoom: true,
|
||||||
hasZoom: true,
|
hasPan: true,
|
||||||
hasPan: true,
|
marginLeft: '10',
|
||||||
marginLeft: '10',
|
marginRight: '10',
|
||||||
marginRight: '10',
|
idKey: "mac",
|
||||||
idKey: "mac",
|
hasFlatData: false,
|
||||||
hasFlatData: false,
|
relationnalField: "children",
|
||||||
relationnalField: "children",
|
linkWidth: (nodeData) => 2,
|
||||||
linkWidth: (nodeData) => 2,
|
linkColor: (nodeData) => {
|
||||||
linkColor: (nodeData) => {
|
relConf = getRelationshipConf(nodeData.data.relType)
|
||||||
relConf = getRelationshipConf(nodeData.data.relType)
|
return relConf.color;
|
||||||
return relConf.color;
|
}
|
||||||
}
|
// onNodeClick: (nodeData) => handleNodeClick(nodeData),
|
||||||
// onNodeClick: (nodeData) => handleNodeClick(nodeData),
|
});
|
||||||
});
|
|
||||||
|
|
||||||
console.log(deviceListGlobal);
|
console.log(deviceListGlobal);
|
||||||
myTree.refresh(myHierarchy);
|
myTree.refresh(myHierarchy);
|
||||||
|
|
||||||
// hide spinning icon
|
// hide spinning icon
|
||||||
hideSpinner()
|
hideSpinner()
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
console.error("getHierarchy() not returning expected result");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ function saveSettings()
|
|||||||
|
|
||||||
// save to the file
|
// save to the file
|
||||||
$new_name = $config_file.'_'.$timestamp.'.backup';
|
$new_name = $config_file.'_'.$timestamp.'.backup';
|
||||||
$new_location = $configFolderPath.$new_name;
|
$new_location = $configFolderPath.'/'.$new_name;
|
||||||
|
|
||||||
if(file_exists( $fullConfPath) != 1)
|
if(file_exists( $fullConfPath) != 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "تصفية",
|
"Gen_Filter": "تصفية",
|
||||||
"Gen_Generate": "إنشاء",
|
"Gen_Generate": "إنشاء",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "قاعدة البيانات مقفلة",
|
"Gen_LockedDB": "قاعدة البيانات مقفلة",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "غير متصل",
|
"Gen_Offline": "غير متصل",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtrar",
|
"Gen_Filter": "Filtrar",
|
||||||
"Gen_Generate": "Generar",
|
"Gen_Generate": "Generar",
|
||||||
"Gen_InvalidMac": "Mac address invàlida.",
|
"Gen_InvalidMac": "Mac address invàlida.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ERROR - DB podria estar bloquejada - Fes servir F12 Eines desenvolupament -> Consola o provar-ho més tard.",
|
"Gen_LockedDB": "ERROR - DB podria estar bloquejada - Fes servir F12 Eines desenvolupament -> Consola o provar-ho més tard.",
|
||||||
"Gen_NetworkMask": "Màscara de xarxa",
|
"Gen_NetworkMask": "Màscara de xarxa",
|
||||||
"Gen_Offline": "Fora de línia",
|
"Gen_Offline": "Fora de línia",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtr",
|
"Gen_Filter": "Filtr",
|
||||||
"Gen_Generate": "Vygenerovat",
|
"Gen_Generate": "Vygenerovat",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "CHYBA - Databáze je možná zamčená - Zkontrolujte F12 -> Nástroje pro vývojáře -> Konzole. nebo to zkuste později.",
|
"Gen_LockedDB": "CHYBA - Databáze je možná zamčená - Zkontrolujte F12 -> Nástroje pro vývojáře -> Konzole. nebo to zkuste později.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -315,6 +315,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "Generieren",
|
"Gen_Generate": "Generieren",
|
||||||
"Gen_InvalidMac": "Ungültige MAC-Adresse.",
|
"Gen_InvalidMac": "Ungültige MAC-Adresse.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"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_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "Generate",
|
"Gen_Generate": "Generate",
|
||||||
"Gen_InvalidMac": "Invalid Mac address.",
|
"Gen_InvalidMac": "Invalid Mac address.",
|
||||||
|
"Gen_Invalid_Value": "An invalid value was entered",
|
||||||
"Gen_LockedDB": "ERROR - DB might be locked - Check F12 Dev tools -> Console or try later.",
|
"Gen_LockedDB": "ERROR - DB might be locked - Check F12 Dev tools -> Console or try later.",
|
||||||
"Gen_NetworkMask": "Network mask",
|
"Gen_NetworkMask": "Network mask",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Generar",
|
"Gen_Generate": "Generar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "Fallo - La base de datos puede estar bloqueada - Pulsa F1 -> Ajustes de desarrolladores -> Consola o prueba más tarde.",
|
"Gen_LockedDB": "Fallo - La base de datos puede estar bloqueada - Pulsa F1 -> Ajustes de desarrolladores -> Consola o prueba más tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Desconectado",
|
"Gen_Offline": "Desconectado",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "",
|
"Gen_Filter": "",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "",
|
"Gen_LockedDB": "",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "",
|
"Gen_Offline": "",
|
||||||
|
|||||||
1
front/php/templates/language/fr_fr.json
Executable file → Normal file
1
front/php/templates/language/fr_fr.json
Executable file → Normal file
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtrer",
|
"Gen_Filter": "Filtrer",
|
||||||
"Gen_Generate": "Générer",
|
"Gen_Generate": "Générer",
|
||||||
"Gen_InvalidMac": "Adresse MAC invalide.",
|
"Gen_InvalidMac": "Adresse MAC invalide.",
|
||||||
|
"Gen_Invalid_Value": "Une valeur invalide a été renseignée",
|
||||||
"Gen_LockedDB": "Erreur - La base de données est peut-être verrouillée - Vérifier avec les outils de dév via F12 -> Console ou essayer plus tard.",
|
"Gen_LockedDB": "Erreur - La base de données est peut-être verrouillée - Vérifier avec les outils de dév via F12 -> Console ou essayer plus tard.",
|
||||||
"Gen_NetworkMask": "Masque réseau",
|
"Gen_NetworkMask": "Masque réseau",
|
||||||
"Gen_Offline": "Hors ligne",
|
"Gen_Offline": "Hors ligne",
|
||||||
|
|||||||
1
front/php/templates/language/it_it.json
Executable file → Normal file
1
front/php/templates/language/it_it.json
Executable file → Normal file
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Genera",
|
"Gen_Generate": "Genera",
|
||||||
"Gen_InvalidMac": "Indirizzo Mac non valido.",
|
"Gen_InvalidMac": "Indirizzo Mac non valido.",
|
||||||
|
"Gen_Invalid_Value": "È stato inserito un valore non valido",
|
||||||
"Gen_LockedDB": "ERRORE: il DB potrebbe essere bloccato, controlla F12 Strumenti di sviluppo -> Console o riprova più tardi.",
|
"Gen_LockedDB": "ERRORE: il DB potrebbe essere bloccato, controlla F12 Strumenti di sviluppo -> Console o riprova più tardi.",
|
||||||
"Gen_NetworkMask": "Maschera di rete",
|
"Gen_NetworkMask": "Maschera di rete",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "FEIL - DB kan være låst - Sjekk F12 Dev tools -> Konsoll eller prøv senere.",
|
"Gen_LockedDB": "FEIL - DB kan være låst - Sjekk F12 Dev tools -> Konsoll eller prøv senere.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Frakoblet",
|
"Gen_Offline": "Frakoblet",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtr",
|
"Gen_Filter": "Filtr",
|
||||||
"Gen_Generate": "Wygeneruj",
|
"Gen_Generate": "Wygeneruj",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "Błąd - Baza danych może być zablokowana - Sprawdź narzędzia deweloperskie F12 -> Konsola lub spróbuj później.",
|
"Gen_LockedDB": "Błąd - Baza danych może być zablokowana - Sprawdź narzędzia deweloperskie F12 -> Konsola lub spróbuj później.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Niedostępne",
|
"Gen_Offline": "Niedostępne",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Gerar",
|
"Gen_Generate": "Gerar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
"Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
"BackDevices_darkmode_disabled": "Modo Noturno Desativado",
|
"BackDevices_darkmode_disabled": "Modo Noturno Desativado",
|
||||||
"BackDevices_darkmode_enabled": "Modo Noturno Ativado",
|
"BackDevices_darkmode_enabled": "Modo Noturno Ativado",
|
||||||
"CLEAR_NEW_FLAG_description": "Se ativado (<code>0</code> está desativado), dispositivos marcados como<b>Novo Dispositivo</b> serão desmarcados se o limite (especificado em horas) exceder o tempo da <b>Primeira Sessão </b>.",
|
"CLEAR_NEW_FLAG_description": "Se ativado (<code>0</code> está desativado), dispositivos marcados como<b>Novo Dispositivo</b> serão desmarcados se o limite (especificado em horas) exceder o tempo da <b>Primeira Sessão </b>.",
|
||||||
"CLEAR_NEW_FLAG_name": "",
|
"CLEAR_NEW_FLAG_name": "Limpar a flag nova",
|
||||||
"CustProps_cant_remove": "Não é possível remover, é necessária pelo menos uma propriedade.",
|
"CustProps_cant_remove": "Não é possível remover, é necessária pelo menos uma propriedade.",
|
||||||
"DAYS_TO_KEEP_EVENTS_description": "Esta é uma definição de manutenção. Especifica o número de dias de entradas de eventos que serão mantidas. Todos os eventos mais antigos serão apagados periodicamente. Também se aplica ao Histórico de eventos do plug-in.",
|
"DAYS_TO_KEEP_EVENTS_description": "Esta é uma definição de manutenção. Especifica o número de dias de entradas de eventos que serão mantidas. Todos os eventos mais antigos serão apagados periodicamente. Também se aplica ao Histórico de eventos do plug-in.",
|
||||||
"DAYS_TO_KEEP_EVENTS_name": "Apagar eventos mais antigos que",
|
"DAYS_TO_KEEP_EVENTS_name": "Apagar eventos mais antigos que",
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
"DevDetail_CustomProps_reset_info": "Isto irá remover as suas propriedades personalizadas neste dispositivo e repô-las para o valor predefinido.",
|
"DevDetail_CustomProps_reset_info": "Isto irá remover as suas propriedades personalizadas neste dispositivo e repô-las para o valor predefinido.",
|
||||||
"DevDetail_DisplayFields_Title": "Visualização",
|
"DevDetail_DisplayFields_Title": "Visualização",
|
||||||
"DevDetail_EveandAl_AlertAllEvents": "Eventos de alerta",
|
"DevDetail_EveandAl_AlertAllEvents": "Eventos de alerta",
|
||||||
"DevDetail_EveandAl_AlertDown": "",
|
"DevDetail_EveandAl_AlertDown": "Alerta apagado",
|
||||||
"DevDetail_EveandAl_Archived": "Arquivado",
|
"DevDetail_EveandAl_Archived": "Arquivado",
|
||||||
"DevDetail_EveandAl_NewDevice": "Novo dispositivo",
|
"DevDetail_EveandAl_NewDevice": "Novo dispositivo",
|
||||||
"DevDetail_EveandAl_NewDevice_Tooltip": "",
|
"DevDetail_EveandAl_NewDevice_Tooltip": "Mostrará o estado “Novo” para o dispositivo e irá incluí-lo nas listas quando o filtro de “Novos dispositivos” estiver ativo. Não afeta as notificações.",
|
||||||
"DevDetail_EveandAl_RandomMAC": "MAC Aleatório",
|
"DevDetail_EveandAl_RandomMAC": "MAC Aleatório",
|
||||||
"DevDetail_EveandAl_ScanCycle": "Rastrear dispositivo",
|
"DevDetail_EveandAl_ScanCycle": "Rastrear dispositivo",
|
||||||
"DevDetail_EveandAl_ScanCycle_a": "Rastear dispositivo",
|
"DevDetail_EveandAl_ScanCycle_a": "Rastear dispositivo",
|
||||||
@@ -103,11 +103,11 @@
|
|||||||
"DevDetail_MainInfo_Type": "Tipo",
|
"DevDetail_MainInfo_Type": "Tipo",
|
||||||
"DevDetail_MainInfo_Vendor": "Fornecedor",
|
"DevDetail_MainInfo_Vendor": "Fornecedor",
|
||||||
"DevDetail_MainInfo_mac": "MAC",
|
"DevDetail_MainInfo_mac": "MAC",
|
||||||
"DevDetail_NavToChildNode": "",
|
"DevDetail_NavToChildNode": "Expandir subelemento",
|
||||||
"DevDetail_Network_Node_hover": "Selecione o dispositivo de rede principal ao qual o dispositivo atual está conectado, para preencher a árvore Rede.",
|
"DevDetail_Network_Node_hover": "Selecione o dispositivo de rede principal ao qual o dispositivo atual está conectado, para preencher a árvore Rede.",
|
||||||
"DevDetail_Network_Port_hover": "A porta a que este dispositivo está ligado no dispositivo de rede principal. Se for deixado vazio, é apresentado um ícone wifi na árvore Rede.",
|
"DevDetail_Network_Port_hover": "A porta a que este dispositivo está ligado no dispositivo de rede principal. Se for deixado vazio, é apresentado um ícone wifi na árvore Rede.",
|
||||||
"DevDetail_Nmap_Scans": "Varreduras manuais do Nmap",
|
"DevDetail_Nmap_Scans": "Varreduras manuais do Nmap",
|
||||||
"DevDetail_Nmap_Scans_desc": "",
|
"DevDetail_Nmap_Scans_desc": "Aqui pode executar análises NMAP manuais. Também pode agendar análises NMAP automáticas regulares através do plugin Serviços & Portos (NMAP). Aceda à https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/nmap_scan para saber mais",
|
||||||
"DevDetail_Nmap_buttonDefault": "Verificação predefinida",
|
"DevDetail_Nmap_buttonDefault": "Verificação predefinida",
|
||||||
"DevDetail_Nmap_buttonDefault_text": "Scan padrão: Nmap verifica as 1.000 portas superiores para cada protocolo de digitalização solicitado. Isto atinge cerca de 93% das portas TCP e 49% das portas UDP. (cerca de 5 segundos)",
|
"DevDetail_Nmap_buttonDefault_text": "Scan padrão: Nmap verifica as 1.000 portas superiores para cada protocolo de digitalização solicitado. Isto atinge cerca de 93% das portas TCP e 49% das portas UDP. (cerca de 5 segundos)",
|
||||||
"DevDetail_Nmap_buttonDetail": "Verificação Detalhada",
|
"DevDetail_Nmap_buttonDetail": "Verificação Detalhada",
|
||||||
@@ -155,34 +155,34 @@
|
|||||||
"DevDetail_Tab_NmapTablePort": "Porta",
|
"DevDetail_Tab_NmapTablePort": "Porta",
|
||||||
"DevDetail_Tab_NmapTableService": "Serviço",
|
"DevDetail_Tab_NmapTableService": "Serviço",
|
||||||
"DevDetail_Tab_NmapTableState": "Estado",
|
"DevDetail_Tab_NmapTableState": "Estado",
|
||||||
"DevDetail_Tab_NmapTableText": "",
|
"DevDetail_Tab_NmapTableText": "Configurar uma programação em <a href=\"/settings.php#NMAP_ACTIVE\">Definições</a>",
|
||||||
"DevDetail_Tab_NmapTableTime": "Tempo",
|
"DevDetail_Tab_NmapTableTime": "Tempo",
|
||||||
"DevDetail_Tab_Plugins": "Plugins",
|
"DevDetail_Tab_Plugins": "Plugins",
|
||||||
"DevDetail_Tab_Presence": "Presença",
|
"DevDetail_Tab_Presence": "Presença",
|
||||||
"DevDetail_Tab_Sessions": "Sessões",
|
"DevDetail_Tab_Sessions": "Sessões",
|
||||||
"DevDetail_Tab_Tools": "Ferramentas",
|
"DevDetail_Tab_Tools": "Ferramentas",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Description": "",
|
"DevDetail_Tab_Tools_Internet_Info_Description": "A ferramenta de informações da Internet apresenta dados sobre a ligação à Internet, como endereço IP, cidade, país, código de área e fuso horário.",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Error": "Ocorreu um erro",
|
"DevDetail_Tab_Tools_Internet_Info_Error": "Ocorreu um erro",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Start": "",
|
"DevDetail_Tab_Tools_Internet_Info_Start": "Start Internet Info",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Title": "",
|
"DevDetail_Tab_Tools_Internet_Info_Title": "Internet Info",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Description": "",
|
"DevDetail_Tab_Tools_Nslookup_Description": "Nslookup é uma ferramenta de linha de comandos usada para consultar o Sistema de Nomes de Domínio (DNS). O DNS é um sistema que traduz nomes de domínio, como www.google.com, em endereços IP, como 172.217.0.142.",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Error": "",
|
"DevDetail_Tab_Tools_Nslookup_Error": "Erro: O endereço IP não é válido",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Start": "",
|
"DevDetail_Tab_Tools_Nslookup_Start": "Inicia Nslookup",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Title": "",
|
"DevDetail_Tab_Tools_Nslookup_Title": "Nslookup",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Description": "",
|
"DevDetail_Tab_Tools_Speedtest_Description": "A ferramenta Speedtest mede a velocidade de download, a velocidade de upload e a latência da ligação à Internet.",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Start": "",
|
"DevDetail_Tab_Tools_Speedtest_Start": "Iniciar Speedtest",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Title": "",
|
"DevDetail_Tab_Tools_Speedtest_Title": "Speedtest Online",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Description": "",
|
"DevDetail_Tab_Tools_Traceroute_Description": "Traceroute é um comando de diagnóstico de rede usado para rastrear o caminho que os pacotes de dados percorrem de um anfitrião para outro.<br><br>O comando utiliza o Protocolo de Mensagens de Controlo da Internet (ICMP) para enviar pacotes aos nós intermédios na rota, cada node intermédio responde com um pacote ICMP de tempo limite (TTL expirado).<br><br>O comando utiliza o Protocolo de Mensagens de Controlo da Internet (ICMP) para enviar pacotes aos nodes intermédios na rota, cada node intermédio responde com um pacote ICMP de tempo limite (TTL expirado).<br><br>A saída do comando traceroute apresenta o endereço IP de cada node intermédio na rota.<br><br>O comando traceroute pode ser usado para diagnosticar problemas de rede, como atrasos, perda de pacotes e rotas bloqueadas.",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Error": "",
|
"DevDetail_Tab_Tools_Traceroute_Error": "Erro: O endereço IP não é válido",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Start": "",
|
"DevDetail_Tab_Tools_Traceroute_Start": "Iniciar Traceroute",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Title": "",
|
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
|
||||||
"DevDetail_Tools_WOL": "",
|
"DevDetail_Tools_WOL": "Enviar comando WoL para ",
|
||||||
"DevDetail_Tools_WOL_noti": "",
|
"DevDetail_Tools_WOL_noti": "Wake-on-LAN",
|
||||||
"DevDetail_Tools_WOL_noti_text": "",
|
"DevDetail_Tools_WOL_noti_text": "O comando Wake-on-LAN é enviado para o endereço de broadcast. Se o destino não estiver na sub-rede/VLAN do NetAlertX, o dispositivo de destino não irá responder.",
|
||||||
"DevDetail_Type_hover": "",
|
"DevDetail_Type_hover": "O tipo do dispositivo. Se selecionar um dos dispositivos de rede predefinidos (por exemplo: AP, Firewall, Router, Switch…), eles aparecerão na configuração da árvore de rede como possíveis nós de rede principais.",
|
||||||
"DevDetail_Vendor_hover": "",
|
"DevDetail_Vendor_hover": "O fabricante deve ser detetado automaticamente. Pode substituir ou adicionar um valor personalizado.",
|
||||||
"DevDetail_WOL_Title": "",
|
"DevDetail_WOL_Title": "<i class=\"fa fa-power-off\"></i> Wake-on-LAN",
|
||||||
"DevDetail_button_AddIcon": "",
|
"DevDetail_button_AddIcon": "Adicionar novo ícone",
|
||||||
"DevDetail_button_AddIcon_Help": "Cole uma tag HTML SVG ou um ícone de tag HTML Font Awesome. Leia a <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/ICONS.md\" target=\"_blank\">documentação sobre ícones</a> para obter pormenores.",
|
"DevDetail_button_AddIcon_Help": "Cole uma tag HTML SVG ou um ícone de tag HTML Font Awesome. Leia a <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/ICONS.md\" target=\"_blank\">documentação sobre ícones</a> para obter pormenores.",
|
||||||
"DevDetail_button_AddIcon_Tooltip": "Adicione um novo ícone a este dispositivo que ainda não esteja disponível no menu suspenso.",
|
"DevDetail_button_AddIcon_Tooltip": "Adicione um novo ícone a este dispositivo que ainda não esteja disponível no menu suspenso.",
|
||||||
"DevDetail_button_Delete": "Apagar dispositivo",
|
"DevDetail_button_Delete": "Apagar dispositivo",
|
||||||
@@ -199,23 +199,23 @@
|
|||||||
"Device_MultiEdit_Backup": "",
|
"Device_MultiEdit_Backup": "",
|
||||||
"Device_MultiEdit_Fields": "Editar campos:",
|
"Device_MultiEdit_Fields": "Editar campos:",
|
||||||
"Device_MultiEdit_MassActions": "Ações em massa:",
|
"Device_MultiEdit_MassActions": "Ações em massa:",
|
||||||
"Device_MultiEdit_No_Devices": "",
|
"Device_MultiEdit_No_Devices": "Nenhum dispositivo selecionado.",
|
||||||
"Device_MultiEdit_Tooltip": "Cuidadoso. Clicar aqui aplicará o valor à esquerda a todos os dispositivos selecionados acima.",
|
"Device_MultiEdit_Tooltip": "Cuidadoso. Clicar aqui aplicará o valor à esquerda a todos os dispositivos selecionados acima.",
|
||||||
"Device_Searchbox": "Procurar",
|
"Device_Searchbox": "Procurar",
|
||||||
"Device_Shortcut_AllDevices": "",
|
"Device_Shortcut_AllDevices": "Os meus dispositivos",
|
||||||
"Device_Shortcut_AllNodes": "",
|
"Device_Shortcut_AllNodes": "Todos os Nodes",
|
||||||
"Device_Shortcut_Archived": "Arquivado",
|
"Device_Shortcut_Archived": "Arquivado",
|
||||||
"Device_Shortcut_Connected": "Conectado",
|
"Device_Shortcut_Connected": "Conectado",
|
||||||
"Device_Shortcut_Devices": "Dispositivos",
|
"Device_Shortcut_Devices": "Dispositivos",
|
||||||
"Device_Shortcut_DownAlerts": "Inativo e off-line",
|
"Device_Shortcut_DownAlerts": "Inativo e off-line",
|
||||||
"Device_Shortcut_DownOnly": "Inativo",
|
"Device_Shortcut_DownOnly": "Inativo",
|
||||||
"Device_Shortcut_Favorites": "Favoritos",
|
"Device_Shortcut_Favorites": "Favoritos",
|
||||||
"Device_Shortcut_NewDevices": "",
|
"Device_Shortcut_NewDevices": "Novo dispostivo",
|
||||||
"Device_Shortcut_OnlineChart": "Presença do dispositivo",
|
"Device_Shortcut_OnlineChart": "Presença do dispositivo",
|
||||||
"Device_TableHead_AlertDown": "Alerta em baixo",
|
"Device_TableHead_AlertDown": "Alerta em baixo",
|
||||||
"Device_TableHead_Connected_Devices": "Conexões",
|
"Device_TableHead_Connected_Devices": "Conexões",
|
||||||
"Device_TableHead_CustomProps": "",
|
"Device_TableHead_CustomProps": "Propriedades / Ações",
|
||||||
"Device_TableHead_FQDN": "",
|
"Device_TableHead_FQDN": "FQDN",
|
||||||
"Device_TableHead_Favorite": "Favorito",
|
"Device_TableHead_Favorite": "Favorito",
|
||||||
"Device_TableHead_FirstSession": "Primeira sessão",
|
"Device_TableHead_FirstSession": "Primeira sessão",
|
||||||
"Device_TableHead_GUID": "GUID",
|
"Device_TableHead_GUID": "GUID",
|
||||||
@@ -230,11 +230,11 @@
|
|||||||
"Device_TableHead_Name": "Nome",
|
"Device_TableHead_Name": "Nome",
|
||||||
"Device_TableHead_NetworkSite": "Site da rede",
|
"Device_TableHead_NetworkSite": "Site da rede",
|
||||||
"Device_TableHead_Owner": "Proprietário",
|
"Device_TableHead_Owner": "Proprietário",
|
||||||
"Device_TableHead_ParentRelType": "",
|
"Device_TableHead_ParentRelType": "Tipo de relação",
|
||||||
"Device_TableHead_Parent_MAC": "",
|
"Device_TableHead_Parent_MAC": "Node de rede anterior",
|
||||||
"Device_TableHead_Port": "Porta",
|
"Device_TableHead_Port": "Porta",
|
||||||
"Device_TableHead_PresentLastScan": "Presença",
|
"Device_TableHead_PresentLastScan": "Presença",
|
||||||
"Device_TableHead_ReqNicsOnline": "",
|
"Device_TableHead_ReqNicsOnline": "Exigir NICs online",
|
||||||
"Device_TableHead_RowID": "ID da linha",
|
"Device_TableHead_RowID": "ID da linha",
|
||||||
"Device_TableHead_Rowid": "ID da linha",
|
"Device_TableHead_Rowid": "ID da linha",
|
||||||
"Device_TableHead_SSID": "SSID",
|
"Device_TableHead_SSID": "SSID",
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
"ENCRYPTION_KEY_name": "Chave de encriptação",
|
"ENCRYPTION_KEY_name": "Chave de encriptação",
|
||||||
"Email_display_name": "Email",
|
"Email_display_name": "Email",
|
||||||
"Email_icon": "<i class=\"fa fa-at\"></i>",
|
"Email_icon": "<i class=\"fa fa-at\"></i>",
|
||||||
"Events_Loading": "",
|
"Events_Loading": "A carregar…",
|
||||||
"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",
|
||||||
"Events_Periodselect_LastWeek": "Semana passada",
|
"Events_Periodselect_LastWeek": "Semana passada",
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
"Events_Shortcut_DownAlerts": "Alertas de queda",
|
"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": "",
|
"Events_Shortcut_NewDevices": "Novos dispositivos",
|
||||||
"Events_Shortcut_Sessions": "Sessões",
|
"Events_Shortcut_Sessions": "Sessões",
|
||||||
"Events_Shortcut_VoidSessions": "Sessões anuladas",
|
"Events_Shortcut_VoidSessions": "Sessões anuladas",
|
||||||
"Events_TableHead_AdditionalInfo": "Informação adicional",
|
"Events_TableHead_AdditionalInfo": "Informação adicional",
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
"Events_TableHead_Disconnection": "Desconexão",
|
"Events_TableHead_Disconnection": "Desconexão",
|
||||||
"Events_TableHead_Duration": "Duração",
|
"Events_TableHead_Duration": "Duração",
|
||||||
"Events_TableHead_DurationOrder": "Duração do pedido",
|
"Events_TableHead_DurationOrder": "Duração do pedido",
|
||||||
"Events_TableHead_EventType": "",
|
"Events_TableHead_EventType": "Tipos de eventos",
|
||||||
"Events_TableHead_IP": "IP",
|
"Events_TableHead_IP": "IP",
|
||||||
"Events_TableHead_IPOrder": "Pedido de IP",
|
"Events_TableHead_IPOrder": "Pedido de IP",
|
||||||
"Events_TableHead_Order": "Ordem",
|
"Events_TableHead_Order": "Ordem",
|
||||||
@@ -294,15 +294,15 @@
|
|||||||
"GRAPHQL_PORT_name": "Porta GraphQL",
|
"GRAPHQL_PORT_name": "Porta GraphQL",
|
||||||
"Gen_Action": "Ação",
|
"Gen_Action": "Ação",
|
||||||
"Gen_Add": "Adicionar",
|
"Gen_Add": "Adicionar",
|
||||||
"Gen_AddDevice": "",
|
"Gen_AddDevice": "Adicionar dispositivo",
|
||||||
"Gen_Add_All": "Adicionar todos",
|
"Gen_Add_All": "Adicionar todos",
|
||||||
"Gen_All_Devices": "",
|
"Gen_All_Devices": "Todos os dispostivos",
|
||||||
"Gen_AreYouSure": "Tem certeza?",
|
"Gen_AreYouSure": "Tem certeza?",
|
||||||
"Gen_Backup": "Executar backup",
|
"Gen_Backup": "Executar backup",
|
||||||
"Gen_Cancel": "Cancelar",
|
"Gen_Cancel": "Cancelar",
|
||||||
"Gen_Change": "Alterar",
|
"Gen_Change": "Alterar",
|
||||||
"Gen_Copy": "Executar",
|
"Gen_Copy": "Executar",
|
||||||
"Gen_CopyToClipboard": "",
|
"Gen_CopyToClipboard": "Copiar para a área de transferência",
|
||||||
"Gen_DataUpdatedUITakesTime": "OK - Pode levar um tempo para a interface do utilizador ser atualizada se uma verificação estiver em execução.",
|
"Gen_DataUpdatedUITakesTime": "OK - Pode levar um tempo para a interface do utilizador ser atualizada se uma verificação estiver em execução.",
|
||||||
"Gen_Delete": "Apagar",
|
"Gen_Delete": "Apagar",
|
||||||
"Gen_DeleteAll": "Apagar todos",
|
"Gen_DeleteAll": "Apagar todos",
|
||||||
@@ -310,9 +310,10 @@
|
|||||||
"Gen_Error": "Erro",
|
"Gen_Error": "Erro",
|
||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Gerar",
|
"Gen_Generate": "Gerar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_Invalid_Value": "",
|
||||||
|
"Gen_InvalidMac": "Endereço MAC Inválido.",
|
||||||
"Gen_LockedDB": "ERRO - A base de dados pode estar bloqueada - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
"Gen_LockedDB": "ERRO - A base de dados pode estar bloqueada - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "Máscara de Rede",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
"Gen_Okay": "Ok",
|
"Gen_Okay": "Ok",
|
||||||
"Gen_Online": "Online",
|
"Gen_Online": "Online",
|
||||||
@@ -329,8 +330,8 @@
|
|||||||
"Gen_Select": "Selecionar",
|
"Gen_Select": "Selecionar",
|
||||||
"Gen_SelectIcon": "<i class=\"fa-solid fa-chevron-down fa-fade\"></i>",
|
"Gen_SelectIcon": "<i class=\"fa-solid fa-chevron-down fa-fade\"></i>",
|
||||||
"Gen_SelectToPreview": "Selecionar para pré-visualizar",
|
"Gen_SelectToPreview": "Selecionar para pré-visualizar",
|
||||||
"Gen_Selected_Devices": "",
|
"Gen_Selected_Devices": "Seleciona dispostivos:",
|
||||||
"Gen_Subnet": "",
|
"Gen_Subnet": "Sub-rede",
|
||||||
"Gen_Switch": "Trocar",
|
"Gen_Switch": "Trocar",
|
||||||
"Gen_Upd": "Atualizado com sucesso",
|
"Gen_Upd": "Atualizado com sucesso",
|
||||||
"Gen_Upd_Fail": "A atualização falhou",
|
"Gen_Upd_Fail": "A atualização falhou",
|
||||||
@@ -344,14 +345,14 @@
|
|||||||
"General_display_name": "Geral",
|
"General_display_name": "Geral",
|
||||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||||
"HRS_TO_KEEP_NEWDEV_description": "",
|
"HRS_TO_KEEP_NEWDEV_description": "",
|
||||||
"HRS_TO_KEEP_NEWDEV_name": "",
|
"HRS_TO_KEEP_NEWDEV_name": "Remover novos dispostivos depois",
|
||||||
"HRS_TO_KEEP_OFFDEV_description": "",
|
"HRS_TO_KEEP_OFFDEV_description": "",
|
||||||
"HRS_TO_KEEP_OFFDEV_name": "Apagar dispositivos offline após",
|
"HRS_TO_KEEP_OFFDEV_name": "Apagar dispositivos offline após",
|
||||||
"LOADED_PLUGINS_description": "Quais plugins carregar. Adicionar plugins pode deixar a aplicação lenta. Leia mais sobre quais plugins precisam ser ativados, tipos ou opções de escaneamento na <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md\">documentação de plugins</a>. Plugins descarregados perderão as suas configurações. Somente plugins <code>desativados</code> podem ser descarregados.",
|
"LOADED_PLUGINS_description": "Quais plugins carregar. Adicionar plugins pode deixar a aplicação lenta. Leia mais sobre quais plugins precisam ser ativados, tipos ou opções de escaneamento na <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md\">documentação de plugins</a>. Plugins descarregados perderão as suas configurações. Somente plugins <code>desativados</code> podem ser descarregados.",
|
||||||
"LOADED_PLUGINS_name": "Plugins carregados",
|
"LOADED_PLUGINS_name": "Plugins carregados",
|
||||||
"LOG_LEVEL_description": "Esta definição permite um registo mais detalhado. Útil para depurar eventos gravados na base de dados.",
|
"LOG_LEVEL_description": "Esta definição permite um registo mais detalhado. Útil para depurar eventos gravados na base de dados.",
|
||||||
"LOG_LEVEL_name": "Imprimir registo adicional",
|
"LOG_LEVEL_name": "Imprimir registo adicional",
|
||||||
"Loading": "",
|
"Loading": "A carregar…",
|
||||||
"Login_Box": "Introduza a sua palavra-passe",
|
"Login_Box": "Introduza a sua palavra-passe",
|
||||||
"Login_Default_PWD": "A palavra-passe predefinida “123456” ainda está ativa.",
|
"Login_Default_PWD": "A palavra-passe predefinida “123456” ainda está ativa.",
|
||||||
"Login_Info": "As palavra-passes são definidas por meio do plugin Definir palavra-passe. Verifique a <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/set_password\">documentação do SETPWD</a> se tiver problemas para fazer login.",
|
"Login_Info": "As palavra-passes são definidas por meio do plugin Definir palavra-passe. Verifique a <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/set_password\">documentação do SETPWD</a> se tiver problemas para fazer login.",
|
||||||
@@ -369,20 +370,20 @@
|
|||||||
"Maint_PurgeLog": "Limpar o registo",
|
"Maint_PurgeLog": "Limpar o registo",
|
||||||
"Maint_RestartServer": "Reiniciar o servidor",
|
"Maint_RestartServer": "Reiniciar o servidor",
|
||||||
"Maint_Restart_Server_noti_text": "Tem certeza de que deseja reiniciar o servidor backend? Isto pode causar inconsistência na app. Faça primeiro um backup da sua configuração. <br/> <br/> Nota: Isto pode levar alguns minutos.",
|
"Maint_Restart_Server_noti_text": "Tem certeza de que deseja reiniciar o servidor backend? Isto pode causar inconsistência na app. Faça primeiro um backup da sua configuração. <br/> <br/> Nota: Isto pode levar alguns minutos.",
|
||||||
"Maintenance_InitCheck": "",
|
"Maintenance_InitCheck": "Verificação inicial",
|
||||||
"Maintenance_InitCheck_Checking": "",
|
"Maintenance_InitCheck_Checking": "A verificar…",
|
||||||
"Maintenance_InitCheck_QuickSetupGuide": "",
|
"Maintenance_InitCheck_QuickSetupGuide": "Certifique-se de que seguiu o <a href=\"https://jokob-sk.github.io/NetAlertX/INITIAL_SETUP/\" target=\"_blank\">guia de configuração rápida</a>.",
|
||||||
"Maintenance_InitCheck_Success": "",
|
"Maintenance_InitCheck_Success": "Aplicação inicializada com sucesso!",
|
||||||
"Maintenance_ReCheck": "",
|
"Maintenance_ReCheck": "Verificar novamente",
|
||||||
"Maintenance_Running_Version": "Versão instalada",
|
"Maintenance_Running_Version": "Versão instalada",
|
||||||
"Maintenance_Status": "Situação",
|
"Maintenance_Status": "Situação",
|
||||||
"Maintenance_Title": "Ferramentas de manutenção",
|
"Maintenance_Title": "Ferramentas de manutenção",
|
||||||
"Maintenance_Tool_DownloadConfig": "",
|
"Maintenance_Tool_DownloadConfig": "Exportar Definições",
|
||||||
"Maintenance_Tool_DownloadConfig_text": "Descarregue um backup completo da configuração das Configurações armazenada no ficheiro <code>app.conf</code>.",
|
"Maintenance_Tool_DownloadConfig_text": "Descarregue um backup completo da configuração das Configurações armazenada no ficheiro <code>app.conf</code>.",
|
||||||
"Maintenance_Tool_DownloadWorkflows": "",
|
"Maintenance_Tool_DownloadWorkflows": "Exportar Workflows",
|
||||||
"Maintenance_Tool_DownloadWorkflows_text": "",
|
"Maintenance_Tool_DownloadWorkflows_text": "Descarregue uma cópia completa de segurança dos seus Workflows armazenados no ficheiro <code>workflows.json</code> .",
|
||||||
"Maintenance_Tool_ExportCSV": "",
|
"Maintenance_Tool_ExportCSV": "Exportar dispostivos (csv)",
|
||||||
"Maintenance_Tool_ExportCSV_noti": "",
|
"Maintenance_Tool_ExportCSV_noti": "Exportar dispostivos (csv)",
|
||||||
"Maintenance_Tool_ExportCSV_noti_text": "Tem a certeza de que pretende gerar um ficheiro CSV?",
|
"Maintenance_Tool_ExportCSV_noti_text": "Tem a certeza de que pretende gerar um ficheiro CSV?",
|
||||||
"Maintenance_Tool_ExportCSV_text": "Gere um ficheiro CSV (valor separado por vírgula) contendo a lista de dispositivos, incluindo os relacionamentos de rede entre os nós de rede e os dispositivos conectados. Também pode acionar isto a aceder esta URL <code>your_NetAlertX_url/php/server/devices.php?action=ExportCSV</code> ou ativando o plugin <a href=\"settings.php#CSVBCKP_header\">CSV Backup</a>.",
|
"Maintenance_Tool_ExportCSV_text": "Gere um ficheiro CSV (valor separado por vírgula) contendo a lista de dispositivos, incluindo os relacionamentos de rede entre os nós de rede e os dispositivos conectados. Também pode acionar isto a aceder esta URL <code>your_NetAlertX_url/php/server/devices.php?action=ExportCSV</code> ou ativando o plugin <a href=\"settings.php#CSVBCKP_header\">CSV Backup</a>.",
|
||||||
"Maintenance_Tool_ImportCSV": "Importação de dispositivos (csv)",
|
"Maintenance_Tool_ImportCSV": "Importação de dispositivos (csv)",
|
||||||
@@ -413,31 +414,31 @@
|
|||||||
"Maintenance_Tool_del_ActHistory_noti": "Apagar atividade de rede",
|
"Maintenance_Tool_del_ActHistory_noti": "Apagar atividade de rede",
|
||||||
"Maintenance_Tool_del_ActHistory_noti_text": "Tem certeza de que deseja redefinir a atividade da rede?",
|
"Maintenance_Tool_del_ActHistory_noti_text": "Tem certeza de que deseja redefinir a atividade da rede?",
|
||||||
"Maintenance_Tool_del_ActHistory_text": "O gráfico de atividade da rede é redefinido. Isto não afeta os eventos.",
|
"Maintenance_Tool_del_ActHistory_text": "O gráfico de atividade da rede é redefinido. Isto não afeta os eventos.",
|
||||||
"Maintenance_Tool_del_alldev": "",
|
"Maintenance_Tool_del_alldev": "Remover todos os dispositivo",
|
||||||
"Maintenance_Tool_del_alldev_noti": "",
|
"Maintenance_Tool_del_alldev_noti": "Remover dispositivos",
|
||||||
"Maintenance_Tool_del_alldev_noti_text": "Tem certeza de que deseja apagar todos os dispositivos?",
|
"Maintenance_Tool_del_alldev_noti_text": "Tem certeza de que deseja apagar todos os dispositivos?",
|
||||||
"Maintenance_Tool_del_alldev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos serão apagados da base de dados.",
|
"Maintenance_Tool_del_alldev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_allevents": "Apagar eventos (Repor presença)",
|
"Maintenance_Tool_del_allevents": "Apagar eventos (Repor presença)",
|
||||||
"Maintenance_Tool_del_allevents30": "Apagar todos os eventos com mais que 30 dias",
|
"Maintenance_Tool_del_allevents30": "Apagar todos os eventos com mais que 30 dias",
|
||||||
"Maintenance_Tool_del_allevents30_noti": "Apagar eventos",
|
"Maintenance_Tool_del_allevents30_noti": "Apagar eventos",
|
||||||
"Maintenance_Tool_del_allevents30_noti_text": "",
|
"Maintenance_Tool_del_allevents30_noti_text": "Tem a certeza de que pretende eliminar todos os Eventos com mais de 30 dias? Isto repõe a presença de todos os dispositivos.",
|
||||||
"Maintenance_Tool_del_allevents30_text": "Antes de utilizar esta função, faça uma cópia de segurança. Apagar não pode ser anulado. Todos os eventos com mais que 30 dias na base de dados serão eliminados. Nesse momento, a presença de todos os dispositivos será reiniciada. Este facto pode dar origem a sessões inválidas. Isto significa que os dispositivos são apresentados como “presentes” apesar de estarem offline. Uma verificação enquanto o dispositivo em questão está online resolve o problema.",
|
"Maintenance_Tool_del_allevents30_text": "Antes de utilizar esta função, faça uma cópia de segurança. Apagar não pode ser anulado. Todos os eventos com mais que 30 dias na base de dados serão eliminados. Nesse momento, a presença de todos os dispositivos será reiniciada. Este facto pode dar origem a sessões inválidas. Isto significa que os dispositivos são apresentados como “presentes” apesar de estarem offline. Uma verificação enquanto o dispositivo em questão está online resolve o problema.",
|
||||||
"Maintenance_Tool_del_allevents_noti": "Apagar eventos",
|
"Maintenance_Tool_del_allevents_noti": "Apagar eventos",
|
||||||
"Maintenance_Tool_del_allevents_noti_text": "",
|
"Maintenance_Tool_del_allevents_noti_text": "Tem a certeza de que pretende eliminar todos os Eventos? Isto repõe a presença de todos os dispositivos.",
|
||||||
"Maintenance_Tool_del_allevents_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os eventos na base de dados serão apagados. Nesse momento, a presença de todos os dispositivos será redefinida. Isto pode levar a sessões inválidas. Isto significa que os dispositivos são exibidos como \"presente\" embora estejam offline. Uma varredura enquanto o dispositivo em questão é on-line resolve o problema.",
|
"Maintenance_Tool_del_allevents_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os eventos na base de dados serão apagados. Nesse momento, a presença de todos os dispositivos será redefinida. Isto pode levar a sessões inválidas. Isto significa que os dispositivos são exibidos como \"presente\" embora estejam offline. Uma varredura enquanto o dispositivo em questão é on-line resolve o problema.",
|
||||||
"Maintenance_Tool_del_empty_macs": "",
|
"Maintenance_Tool_del_empty_macs": "Eliminar dispositivos com endereços MACs vazios",
|
||||||
"Maintenance_Tool_del_empty_macs_noti": "",
|
"Maintenance_Tool_del_empty_macs_noti": "Elimitar dispositivos",
|
||||||
"Maintenance_Tool_del_empty_macs_noti_text": "Tem certeza que deseja apagar todos os dispositivos com endereços MAC vazios?<br>(talvez prefira arquivá-los)",
|
"Maintenance_Tool_del_empty_macs_noti_text": "Tem certeza que deseja apagar todos os dispositivos com endereços MAC vazios?<br>(talvez prefira arquivá-los)",
|
||||||
"Maintenance_Tool_del_empty_macs_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos sem MAC serão apagados da base de dados.",
|
"Maintenance_Tool_del_empty_macs_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos sem MAC serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_selecteddev": "Apagar dispositivos selecionados",
|
"Maintenance_Tool_del_selecteddev": "Apagar dispositivos selecionados",
|
||||||
"Maintenance_Tool_del_selecteddev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Dispositivos selecionados serão apagados da base de dados.",
|
"Maintenance_Tool_del_selecteddev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Dispositivos selecionados serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_unknowndev": "",
|
"Maintenance_Tool_del_unknowndev": "Eliminar dispositivos desconhecidos",
|
||||||
"Maintenance_Tool_del_unknowndev_noti": "",
|
"Maintenance_Tool_del_unknowndev_noti": "Eliminar dispositivos desconhecidos",
|
||||||
"Maintenance_Tool_del_unknowndev_noti_text": "Tem certeza que deseja apagar todos (desconhecidos) e (nome não encontrados) dispositivos?",
|
"Maintenance_Tool_del_unknowndev_noti_text": "Tem certeza que deseja apagar todos (desconhecidos) e (nome não encontrados) dispositivos?",
|
||||||
"Maintenance_Tool_del_unknowndev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos nomeados (não conhecidos) serão apagados da base de dados.",
|
"Maintenance_Tool_del_unknowndev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos nomeados (não conhecidos) serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_displayed_columns_text": "Altere a visibilidade e a ordem das colunas na página <a href=\"devices.php\"><b> <i class=\"fa fa-portátil\"></i> Dispositivos</b></a>.",
|
"Maintenance_Tool_displayed_columns_text": "Altere a visibilidade e a ordem das colunas na página <a href=\"devices.php\"><b> <i class=\"fa fa-portátil\"></i> Dispositivos</b></a>.",
|
||||||
"Maintenance_Tool_drag_me": "Arraste-me para reordenar colunas.",
|
"Maintenance_Tool_drag_me": "Arraste-me para reordenar colunas.",
|
||||||
"Maintenance_Tool_order_columns_text": "",
|
"Maintenance_Tool_order_columns_text": "Maintenance_Tool_order_columns_text",
|
||||||
"Maintenance_Tool_purgebackup": "Limpar cópias de segurança",
|
"Maintenance_Tool_purgebackup": "Limpar cópias de segurança",
|
||||||
"Maintenance_Tool_purgebackup_noti": "Limpar cópias de segurança",
|
"Maintenance_Tool_purgebackup_noti": "Limpar cópias de segurança",
|
||||||
"Maintenance_Tool_purgebackup_noti_text": "Tem certeza que deseja apagar todos os backups exceto os últimos 3?",
|
"Maintenance_Tool_purgebackup_noti_text": "Tem certeza que deseja apagar todos os backups exceto os últimos 3?",
|
||||||
@@ -450,13 +451,13 @@
|
|||||||
"Maintenance_Tool_upgrade_database_noti_text": "Tem certeza de que deseja atualizar a base de dados?<br>(talvez prefira arquivá-la)",
|
"Maintenance_Tool_upgrade_database_noti_text": "Tem certeza de que deseja atualizar a base de dados?<br>(talvez prefira arquivá-la)",
|
||||||
"Maintenance_Tool_upgrade_database_text": "Este botão atualizará a base de dados para ativar o gráfico Atividade de rede nas últimas 12 horas. Faça uma cópia de segurança da sua base de dados em caso de problemas.",
|
"Maintenance_Tool_upgrade_database_text": "Este botão atualizará a base de dados para ativar o gráfico Atividade de rede nas últimas 12 horas. Faça uma cópia de segurança da sua base de dados em caso de problemas.",
|
||||||
"Maintenance_Tools_Tab_BackupRestore": "Backup / Restauração",
|
"Maintenance_Tools_Tab_BackupRestore": "Backup / Restauração",
|
||||||
"Maintenance_Tools_Tab_Logging": "",
|
"Maintenance_Tools_Tab_Logging": "Logs",
|
||||||
"Maintenance_Tools_Tab_Settings": "Configurações",
|
"Maintenance_Tools_Tab_Settings": "Configurações",
|
||||||
"Maintenance_Tools_Tab_Tools": "Ferramentas",
|
"Maintenance_Tools_Tab_Tools": "Ferramentas",
|
||||||
"Maintenance_Tools_Tab_UISettings": "Configurações de interface",
|
"Maintenance_Tools_Tab_UISettings": "Configurações de interface",
|
||||||
"Maintenance_arp_status": "Estado de digitalização",
|
"Maintenance_arp_status": "Estado de digitalização",
|
||||||
"Maintenance_arp_status_off": "está atualmente desativado",
|
"Maintenance_arp_status_off": "está atualmente desativado",
|
||||||
"Maintenance_arp_status_on": "",
|
"Maintenance_arp_status_on": "Scan em curso",
|
||||||
"Maintenance_built_on": "Construído em",
|
"Maintenance_built_on": "Construído em",
|
||||||
"Maintenance_current_version": "Você está atualizado. Confira o que <a href=\"https://github.com/jokob-sk/NetAlertX/issues/138\" target=\"_blank\"> estou a trabalhar em</a>.",
|
"Maintenance_current_version": "Você está atualizado. Confira o que <a href=\"https://github.com/jokob-sk/NetAlertX/issues/138\" target=\"_blank\"> estou a trabalhar em</a>.",
|
||||||
"Maintenance_database_backup": "Backups DB",
|
"Maintenance_database_backup": "Backups DB",
|
||||||
@@ -467,8 +468,8 @@
|
|||||||
"Maintenance_database_rows": "Tabela (linhas)",
|
"Maintenance_database_rows": "Tabela (linhas)",
|
||||||
"Maintenance_database_size": "Tamanho da base de dados",
|
"Maintenance_database_size": "Tamanho da base de dados",
|
||||||
"Maintenance_lang_selector_apply": "Aplicar",
|
"Maintenance_lang_selector_apply": "Aplicar",
|
||||||
"Maintenance_lang_selector_empty": "",
|
"Maintenance_lang_selector_empty": "Escolha a lingua",
|
||||||
"Maintenance_lang_selector_lable": "",
|
"Maintenance_lang_selector_lable": "Escolha a lingua",
|
||||||
"Maintenance_lang_selector_text": "A mudança ocorre no lado do cliente, por isso afeta apenas o navegador atual.",
|
"Maintenance_lang_selector_text": "A mudança ocorre no lado do cliente, por isso afeta apenas o navegador atual.",
|
||||||
"Maintenance_new_version": "Uma nova versão está disponível. Confira as <a href=\"https://github.com/jokob-sk/NetAlertX/releases\" target=\"_blank\">notas de lançamento</a>.",
|
"Maintenance_new_version": "Uma nova versão está disponível. Confira as <a href=\"https://github.com/jokob-sk/NetAlertX/releases\" target=\"_blank\">notas de lançamento</a>.",
|
||||||
"Maintenance_themeselector_apply": "Aplicar",
|
"Maintenance_themeselector_apply": "Aplicar",
|
||||||
@@ -476,10 +477,10 @@
|
|||||||
"Maintenance_themeselector_lable": "Selecionar Skin",
|
"Maintenance_themeselector_lable": "Selecionar Skin",
|
||||||
"Maintenance_themeselector_text": "A mudança ocorre no lado do servidor, por isso afeta todos os dispositivos em uso.",
|
"Maintenance_themeselector_text": "A mudança ocorre no lado do servidor, por isso afeta todos os dispositivos em uso.",
|
||||||
"Maintenance_version": "Atualizações de apps",
|
"Maintenance_version": "Atualizações de apps",
|
||||||
"NETWORK_DEVICE_TYPES_description": "",
|
"NETWORK_DEVICE_TYPES_description": "Quais os tipos de dispositivos que podem ser usados como dispositivos de rede na vista de Rede. O tipo de dispositivo tem de corresponder exatamente à definição <code>Type</code> um dispositivo específico em Detalhes do dispositivo. Adicione-o ao dispositivo através do botão <code>+</code>. Não remova tipos existentes, apenas adicione novos.",
|
||||||
"NETWORK_DEVICE_TYPES_name": "Tipos de dispositivo de rede",
|
"NETWORK_DEVICE_TYPES_name": "Tipos de dispositivo de rede",
|
||||||
"Navigation_About": "Sobre a",
|
"Navigation_About": "Sobre a",
|
||||||
"Navigation_AppEvents": "",
|
"Navigation_AppEvents": "Eventos de aplicações",
|
||||||
"Navigation_Devices": "Dispositivos",
|
"Navigation_Devices": "Dispositivos",
|
||||||
"Navigation_Donations": "Doações",
|
"Navigation_Donations": "Doações",
|
||||||
"Navigation_Events": "Eventos",
|
"Navigation_Events": "Eventos",
|
||||||
@@ -489,38 +490,38 @@
|
|||||||
"Navigation_Network": "Rede",
|
"Navigation_Network": "Rede",
|
||||||
"Navigation_Notifications": "Notificações",
|
"Navigation_Notifications": "Notificações",
|
||||||
"Navigation_Plugins": "Plugins",
|
"Navigation_Plugins": "Plugins",
|
||||||
"Navigation_Presence": "",
|
"Navigation_Presence": "Presença",
|
||||||
"Navigation_Report": "",
|
"Navigation_Report": "Reports enviados",
|
||||||
"Navigation_Settings": "",
|
"Navigation_Settings": "Definições",
|
||||||
"Navigation_SystemInfo": "",
|
"Navigation_SystemInfo": "Informação de sistema",
|
||||||
"Navigation_Workflows": "",
|
"Navigation_Workflows": "Workflows",
|
||||||
"Network_Assign": "",
|
"Network_Assign": "Conectar ao nodo de network <i class=\"fa fa-server\"></i> em cima",
|
||||||
"Network_Cant_Assign": "",
|
"Network_Cant_Assign": "Não é possível atribuir o node raiz da Internet como um node folha filho.",
|
||||||
"Network_Cant_Assign_No_Node_Selected": "",
|
"Network_Cant_Assign_No_Node_Selected": "Não é possível atribuir, nenhum node pai selecionado.",
|
||||||
"Network_Configuration_Error": "",
|
"Network_Configuration_Error": "Erro de configuração",
|
||||||
"Network_Connected": "",
|
"Network_Connected": "Dispositivos conectados",
|
||||||
"Network_Devices": "",
|
"Network_Devices": "Dispositivos de rede",
|
||||||
"Network_ManageAdd": "",
|
"Network_ManageAdd": "Adicionar dispositivo",
|
||||||
"Network_ManageAdd_Name": "",
|
"Network_ManageAdd_Name": "Nome do dispositivo",
|
||||||
"Network_ManageAdd_Name_text": "",
|
"Network_ManageAdd_Name_text": "Nome sem caracteres especiais",
|
||||||
"Network_ManageAdd_Port": "",
|
"Network_ManageAdd_Port": "Contagem de portas",
|
||||||
"Network_ManageAdd_Port_text": "",
|
"Network_ManageAdd_Port_text": "Deixe em branco para Wi-Fi e Powerline",
|
||||||
"Network_ManageAdd_Submit": "",
|
"Network_ManageAdd_Submit": "Adicionar dispositivo",
|
||||||
"Network_ManageAdd_Type": "",
|
"Network_ManageAdd_Type": "Tipo de dispositivo",
|
||||||
"Network_ManageAdd_Type_text": "",
|
"Network_ManageAdd_Type_text": "-- Selecionar Tipo --",
|
||||||
"Network_ManageAssign": "",
|
"Network_ManageAssign": "Asignar",
|
||||||
"Network_ManageDel": "",
|
"Network_ManageDel": "Eliminar dispositivo",
|
||||||
"Network_ManageDel_Name": "",
|
"Network_ManageDel_Name": "Dispositivo a eliminar",
|
||||||
"Network_ManageDel_Name_text": "",
|
"Network_ManageDel_Name_text": "-- Seleciona dispositivo --",
|
||||||
"Network_ManageDel_Submit": "",
|
"Network_ManageDel_Submit": "Eliminar",
|
||||||
"Network_ManageDevices": "",
|
"Network_ManageDevices": "Gerir dispositivos",
|
||||||
"Network_ManageEdit": "",
|
"Network_ManageEdit": "Actualizar dispositivos",
|
||||||
"Network_ManageEdit_ID": "",
|
"Network_ManageEdit_ID": "Dispositivos a actualizar",
|
||||||
"Network_ManageEdit_ID_text": "",
|
"Network_ManageEdit_ID_text": "-- Selecionar dispositivo para edição --",
|
||||||
"Network_ManageEdit_Name": "",
|
"Network_ManageEdit_Name": "Novo nome de dispositivo",
|
||||||
"Network_ManageEdit_Name_text": "",
|
"Network_ManageEdit_Name_text": "Nome sem caracteres especiais",
|
||||||
"Network_ManageEdit_Port": "",
|
"Network_ManageEdit_Port": " Nova contagem de portas",
|
||||||
"Network_ManageEdit_Port_text": "",
|
"Network_ManageEdit_Port_text": "Deixe em branco para Wi-Fi e Powerline.",
|
||||||
"Network_ManageEdit_Submit": "",
|
"Network_ManageEdit_Submit": "",
|
||||||
"Network_ManageEdit_Type": "",
|
"Network_ManageEdit_Type": "",
|
||||||
"Network_ManageEdit_Type_text": "",
|
"Network_ManageEdit_Type_text": "",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Фильтр",
|
"Gen_Filter": "Фильтр",
|
||||||
"Gen_Generate": "Генерировать",
|
"Gen_Generate": "Генерировать",
|
||||||
"Gen_InvalidMac": "Неверный Mac-адрес.",
|
"Gen_InvalidMac": "Неверный Mac-адрес.",
|
||||||
|
"Gen_Invalid_Value": "Введено некорректное значение",
|
||||||
"Gen_LockedDB": "ОШИБКА - Возможно, база данных заблокирована. Проверьте инструменты разработчика F12 -> Консоль или повторите попытку позже.",
|
"Gen_LockedDB": "ОШИБКА - Возможно, база данных заблокирована. Проверьте инструменты разработчика F12 -> Консоль или повторите попытку позже.",
|
||||||
"Gen_NetworkMask": "Маска сети",
|
"Gen_NetworkMask": "Маска сети",
|
||||||
"Gen_Offline": "Оффлайн",
|
"Gen_Offline": "Оффлайн",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "",
|
"Gen_Filter": "",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "",
|
"Gen_LockedDB": "",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "",
|
"Gen_Offline": "",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtre",
|
"Gen_Filter": "Filtre",
|
||||||
"Gen_Generate": "Oluştur",
|
"Gen_Generate": "Oluştur",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "HATA - Veritabanı kilitlenmiş olabilir - F12 Geliştirici araçlarını -> Konsol kısmını kontrol edin veya daha sonra tekrar deneyin.",
|
"Gen_LockedDB": "HATA - Veritabanı kilitlenmiş olabilir - F12 Geliştirici araçlarını -> Konsol kısmını kontrol edin veya daha sonra tekrar deneyin.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Çevrimdışı",
|
"Gen_Offline": "Çevrimdışı",
|
||||||
|
|||||||
1
front/php/templates/language/uk_ua.json
Executable file → Normal file
1
front/php/templates/language/uk_ua.json
Executable file → Normal file
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Фільтр",
|
"Gen_Filter": "Фільтр",
|
||||||
"Gen_Generate": "Генерувати",
|
"Gen_Generate": "Генерувати",
|
||||||
"Gen_InvalidMac": "Недійсна Mac-адреса.",
|
"Gen_InvalidMac": "Недійсна Mac-адреса.",
|
||||||
|
"Gen_Invalid_Value": "Введено недійсне значення",
|
||||||
"Gen_LockedDB": "ПОМИЛКА – БД може бути заблоковано – перевірте F12 Інструменти розробника -> Консоль або спробуйте пізніше.",
|
"Gen_LockedDB": "ПОМИЛКА – БД може бути заблоковано – перевірте F12 Інструменти розробника -> Консоль або спробуйте пізніше.",
|
||||||
"Gen_NetworkMask": "Маска мережі",
|
"Gen_NetworkMask": "Маска мережі",
|
||||||
"Gen_Offline": "Офлайн",
|
"Gen_Offline": "Офлайн",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "筛选",
|
"Gen_Filter": "筛选",
|
||||||
"Gen_Generate": "生成",
|
"Gen_Generate": "生成",
|
||||||
"Gen_InvalidMac": "无效的 Mac 地址。",
|
"Gen_InvalidMac": "无效的 Mac 地址。",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "错误 - DB 可能被锁定 - 检查 F12 开发工具 -> 控制台或稍后重试。",
|
"Gen_LockedDB": "错误 - DB 可能被锁定 - 检查 F12 开发工具 -> 控制台或稍后重试。",
|
||||||
"Gen_NetworkMask": "网络掩码",
|
"Gen_NetworkMask": "网络掩码",
|
||||||
"Gen_Offline": "离线",
|
"Gen_Offline": "离线",
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -377,7 +377,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
@@ -98,9 +97,7 @@ def main():
|
|||||||
{"devMac": "00:11:22:33:44:57", "devLastIP": "192.168.1.82"},
|
{"devMac": "00:11:22:33:44:57", "devLastIP": "192.168.1.82"},
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
db = DB()
|
device_handler = DeviceInstance()
|
||||||
db.open()
|
|
||||||
device_handler = DeviceInstance(db)
|
|
||||||
devices = (
|
devices = (
|
||||||
device_handler.getAll()
|
device_handler.getAll()
|
||||||
if get_setting_value("REFRESH_FQDN")
|
if get_setting_value("REFRESH_FQDN")
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -185,7 +185,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -596,7 +596,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -397,7 +397,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
@@ -38,15 +37,11 @@ def main():
|
|||||||
|
|
||||||
timeout = get_setting_value('DIGSCAN_RUN_TIMEOUT')
|
timeout = get_setting_value('DIGSCAN_RUN_TIMEOUT')
|
||||||
|
|
||||||
# Create a database connection
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
|
|
||||||
# Initialize the Plugin obj output file
|
# Initialize the Plugin obj output file
|
||||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||||
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
|
|
||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
if get_setting_value("REFRESH_FQDN"):
|
if get_setting_value("REFRESH_FQDN"):
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
@@ -41,15 +40,11 @@ def main():
|
|||||||
args = get_setting_value('ICMP_ARGS')
|
args = get_setting_value('ICMP_ARGS')
|
||||||
in_regex = get_setting_value('ICMP_IN_REGEX')
|
in_regex = get_setting_value('ICMP_IN_REGEX')
|
||||||
|
|
||||||
# Create a database connection
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
|
|
||||||
# Initialize the Plugin obj output file
|
# Initialize the Plugin obj output file
|
||||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||||
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
|
|
||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
all_devices = device_handler.getAll()
|
all_devices = device_handler.getAll()
|
||||||
|
|||||||
@@ -203,7 +203,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -468,7 +468,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
@@ -40,15 +39,11 @@ def main():
|
|||||||
# timeout = get_setting_value('NBLOOKUP_RUN_TIMEOUT')
|
# timeout = get_setting_value('NBLOOKUP_RUN_TIMEOUT')
|
||||||
timeout = 20
|
timeout = 20
|
||||||
|
|
||||||
# Create a database connection
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
|
|
||||||
# Initialize the Plugin obj output file
|
# Initialize the Plugin obj output file
|
||||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||||
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
|
|
||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
if get_setting_value("REFRESH_FQDN"):
|
if get_setting_value("REFRESH_FQDN"):
|
||||||
|
|||||||
@@ -227,7 +227,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import hashlib
|
|
||||||
import re
|
import re
|
||||||
import nmap
|
import nmap
|
||||||
|
|
||||||
@@ -17,6 +16,7 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
|
from utils.crypto_utils import string_to_mac_hash # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
|
|
||||||
@@ -177,16 +177,6 @@ def parse_nmap_xml(xml_output, interface, fakeMac):
|
|||||||
return devices_list
|
return devices_list
|
||||||
|
|
||||||
|
|
||||||
def string_to_mac_hash(input_string):
|
|
||||||
# Calculate a hash using SHA-256
|
|
||||||
sha256_hash = hashlib.sha256(input_string.encode()).hexdigest()
|
|
||||||
|
|
||||||
# Take the first 12 characters of the hash and format as a MAC address
|
|
||||||
mac_hash = ':'.join(sha256_hash[i:i + 2] for i in range(0, 12, 2))
|
|
||||||
|
|
||||||
return mac_hash
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================================
|
# ===============================================================================
|
||||||
# BEGIN
|
# BEGIN
|
||||||
# ===============================================================================
|
# ===============================================================================
|
||||||
|
|||||||
@@ -476,7 +476,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
@@ -39,15 +38,11 @@ def main():
|
|||||||
|
|
||||||
timeout = get_setting_value('NSLOOKUP_RUN_TIMEOUT')
|
timeout = get_setting_value('NSLOOKUP_RUN_TIMEOUT')
|
||||||
|
|
||||||
# Create a database connection
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
|
|
||||||
# Initialize the Plugin obj output file
|
# Initialize the Plugin obj output file
|
||||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||||
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
|
|
||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
if get_setting_value("REFRESH_FQDN"):
|
if get_setting_value("REFRESH_FQDN"):
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -256,13 +256,11 @@ def main():
|
|||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
mylog("verbose", [f"[{pluginName}] starting execution"])
|
mylog("verbose", [f"[{pluginName}] starting execution"])
|
||||||
from database import DB
|
|
||||||
from models.device_instance import DeviceInstance
|
from models.device_instance import DeviceInstance
|
||||||
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
# Retrieve configuration settings
|
# Retrieve configuration settings
|
||||||
# these should be self-explanatory
|
# these should be self-explanatory
|
||||||
omada_sites = []
|
omada_sites = []
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ The plugin connects to your Pi-hole’s API and retrieves:
|
|||||||
|
|
||||||
NetAlertX then uses this information to match or create devices in your system.
|
NetAlertX then uses this information to match or create devices in your system.
|
||||||
|
|
||||||
> [!TIP]
|
|
||||||
> Some tip.
|
|
||||||
|
|
||||||
### Quick setup guide
|
### Quick setup guide
|
||||||
|
|
||||||
* You are running **Pi-hole v6** or newer.
|
* You are running **Pi-hole v6** or newer.
|
||||||
@@ -30,21 +27,13 @@ No additional Pi-hole configuration is required.
|
|||||||
|
|
||||||
| Setting Key | Description |
|
| Setting Key | Description |
|
||||||
| ---------------------------- | -------------------------------------------------------------------------------- |
|
| ---------------------------- | -------------------------------------------------------------------------------- |
|
||||||
| **PIHOLEAPI_URL** | Your Pi-hole base URL. |
|
| **PIHOLEAPI_URL** | Your Pi-hole base URL. |
|
||||||
| **PIHOLEAPI_PASSWORD** | The Web UI base64 encoded (en-/decoding handled by the app) admin password. |
|
| **PIHOLEAPI_PASSWORD** | The Web UI base64 encoded (en-/decoding handled by the app) admin password. |
|
||||||
| **PIHOLEAPI_SSL_VERIFY** | Whether to verify HTTPS certificates. Disable only for self-signed certificates. |
|
| **PIHOLEAPI_SSL_VERIFY** | Whether to verify HTTPS certificates. Disable only for self-signed certificates. |
|
||||||
| **PIHOLEAPI_RUN_TIMEOUT** | Request timeout in seconds. |
|
| **PIHOLEAPI_RUN_TIMEOUT** | Request timeout in seconds. |
|
||||||
| **PIHOLEAPI_API_MAXCLIENTS** | Maximum number of devices to request from Pi-hole. Defaults are usually fine. |
|
| **PIHOLEAPI_API_MAXCLIENTS** | Maximum number of devices to request from Pi-hole. Defaults are usually fine. |
|
||||||
|
| **PIHOLEAPI_FAKE_MAC** | Generate FAKE MAC from IP. |
|
||||||
|
|
||||||
### Example Configuration
|
|
||||||
|
|
||||||
| Setting Key | Sample Value |
|
|
||||||
| ---------------------------- | -------------------------------------------------- |
|
|
||||||
| **PIHOLEAPI_URL** | `http://pi.hole/` |
|
|
||||||
| **PIHOLEAPI_PASSWORD** | `passw0rd` |
|
|
||||||
| **PIHOLEAPI_SSL_VERIFY** | `true` |
|
|
||||||
| **PIHOLEAPI_RUN_TIMEOUT** | `30` |
|
|
||||||
| **PIHOLEAPI_API_MAXCLIENTS** | `500` |
|
|
||||||
|
|
||||||
### ⚠️ Troubleshooting
|
### ⚠️ Troubleshooting
|
||||||
|
|
||||||
@@ -110,6 +99,32 @@ Then re-run the plugin.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
#### ❌ Some devices are missing
|
||||||
|
|
||||||
|
Check:
|
||||||
|
|
||||||
|
* Pi-hole shows devices under **Settings → Network**
|
||||||
|
* NetAlertX logs contain:
|
||||||
|
|
||||||
|
```
|
||||||
|
[PIHOLEAPI] Skipping invalid MAC (see PIHOLEAPI_FAKE_MAC setting) ...
|
||||||
|
```
|
||||||
|
|
||||||
|
If devices are missing:
|
||||||
|
|
||||||
|
* The app skipps devices with invalid MACs
|
||||||
|
* Enable PIHOLEAPI_FAKE_MAC if you want to import these devices with a fake mac and you are not concerned with data inconsistencies later on
|
||||||
|
|
||||||
|
Try enabling PIHOLEAPI_FAKE_MAC:
|
||||||
|
|
||||||
|
```
|
||||||
|
PIHOLEAPI_FAKE_MAC = 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Then re-run the plugin.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
#### ❌ Wrong or missing hostnames
|
#### ❌ Wrong or missing hostnames
|
||||||
|
|
||||||
Pi-hole only reports names it knows from:
|
Pi-hole only reports names it knows from:
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
@@ -279,6 +279,41 @@
|
|||||||
"string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
"string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "FAKE_MAC",
|
||||||
|
"type": {
|
||||||
|
"dataType": "boolean",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"elementType": "input",
|
||||||
|
"elementOptions": [
|
||||||
|
{
|
||||||
|
"type": "checkbox"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"transformers": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default_value": false,
|
||||||
|
"options": [],
|
||||||
|
"localized": [
|
||||||
|
"name",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "Fake MAC if empty"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": [
|
||||||
|
{
|
||||||
|
"language_code": "en_us",
|
||||||
|
"string": "Some PiHole devices don't have a MAC assigned. Enabling the FAKE_MAC setting generates a fake MAC address from the IP address to track devices, but it may cause inconsistencies if IPs change or devices are re-discovered with a different MAC. Static IPs are recommended. Device type and icon might not be detected correctly and some plugins might fail if they depend on a valid MAC address. When unchecked, devices with empty MAC addresses are skipped."
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"database_column_definitions": [
|
"database_column_definitions": [
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
|||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
|
from utils.crypto_utils import string_to_mac_hash # noqa: E402 [flake8 lint suppression]
|
||||||
|
|
||||||
# Setup timezone & logger using standard NAX helpers
|
# Setup timezone & logger using standard NAX helpers
|
||||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||||
@@ -42,6 +43,7 @@ PIHOLEAPI_SES_CSRF = None
|
|||||||
PIHOLEAPI_API_MAXCLIENTS = None
|
PIHOLEAPI_API_MAXCLIENTS = None
|
||||||
PIHOLEAPI_VERIFY_SSL = True
|
PIHOLEAPI_VERIFY_SSL = True
|
||||||
PIHOLEAPI_RUN_TIMEOUT = 10
|
PIHOLEAPI_RUN_TIMEOUT = 10
|
||||||
|
PIHOLEAPI_FAKE_MAC = get_setting_value('PIHOLEAPI_FAKE_MAC')
|
||||||
VERSION_DATE = "NAX-PIHOLEAPI-1.0"
|
VERSION_DATE = "NAX-PIHOLEAPI-1.0"
|
||||||
|
|
||||||
|
|
||||||
@@ -222,8 +224,14 @@ def gather_device_entries():
|
|||||||
if ip in iplist:
|
if ip in iplist:
|
||||||
lastQuery = str(now_ts)
|
lastQuery = str(now_ts)
|
||||||
|
|
||||||
|
tmpMac = hwaddr.lower()
|
||||||
|
|
||||||
|
# ensure fake mac if enabled
|
||||||
|
if PIHOLEAPI_FAKE_MAC and is_mac(tmpMac) is False:
|
||||||
|
tmpMac = string_to_mac_hash(ip)
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'mac': hwaddr.lower(),
|
'mac': tmpMac,
|
||||||
'ip': ip,
|
'ip': ip,
|
||||||
'name': name,
|
'name': name,
|
||||||
'macVendor': macVendor,
|
'macVendor': macVendor,
|
||||||
@@ -281,7 +289,7 @@ def main():
|
|||||||
foreignKey=str(entry['mac'])
|
foreignKey=str(entry['mac'])
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
mylog('verbose', [f"[{pluginName}] Skipping invalid MAC: {entry['name']}|{entry['mac']}|{entry['ip']}"])
|
mylog('verbose', [f"[{pluginName}] Skipping invalid MAC (see PIHOLEAPI_FAKE_MAC setting): {entry['name']}|{entry['mac']}|{entry['ip']}"])
|
||||||
|
|
||||||
# Write result file for NetAlertX to ingest
|
# Write result file for NetAlertX to ingest
|
||||||
plugin_objects.write_result_file()
|
plugin_objects.write_result_file()
|
||||||
|
|||||||
@@ -182,7 +182,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ Specify the following settings in the Settings section of NetAlertX:
|
|||||||
|
|
||||||
If unsure, please check [snmpwalk examples](https://www.comparitech.com/net-admin/snmpwalk-examples-windows-linux/).
|
If unsure, please check [snmpwalk examples](https://www.comparitech.com/net-admin/snmpwalk-examples-windows-linux/).
|
||||||
|
|
||||||
|
Supported output formats:
|
||||||
|
|
||||||
|
```
|
||||||
|
ipNetToMediaPhysAddress[3][192.168.1.9] 6C:6C:6C:6C:6C:b6C1
|
||||||
|
IP-MIB::ipNetToMediaPhysAddress.17.10.10.3.202 = STRING: f8:81:1a:ef:ef:ef
|
||||||
|
mib-2.3.1.1.2.15.1.192.168.1.14 "2C F4 32 18 61 43 "
|
||||||
|
```
|
||||||
|
|
||||||
### Setup Cisco IOS
|
### Setup Cisco IOS
|
||||||
|
|
||||||
Enable IOS SNMP service and restrict to selected (internal) IP/Subnet.
|
Enable IOS SNMP service and restrict to selected (internal) IP/Subnet.
|
||||||
|
|||||||
@@ -512,7 +512,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
mylog('verbose', ['[SNMPDSC] In script '])
|
mylog('verbose', f"[{pluginName}] In script ")
|
||||||
|
|
||||||
# init global variables
|
# init global variables
|
||||||
global snmpWalkCmds
|
global snmpWalkCmds
|
||||||
@@ -57,7 +57,7 @@ def main():
|
|||||||
commands = [snmpWalkCmds]
|
commands = [snmpWalkCmds]
|
||||||
|
|
||||||
for cmd in commands:
|
for cmd in commands:
|
||||||
mylog('verbose', ['[SNMPDSC] Router snmpwalk command: ', cmd])
|
mylog('verbose', [f"[{pluginName}] Router snmpwalk command: ", cmd])
|
||||||
# split the string, remove white spaces around each item, and exclude any empty strings
|
# split the string, remove white spaces around each item, and exclude any empty strings
|
||||||
snmpwalkArgs = [arg.strip() for arg in cmd.split(' ') if arg.strip()]
|
snmpwalkArgs = [arg.strip() for arg in cmd.split(' ') if arg.strip()]
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ def main():
|
|||||||
timeout=(timeoutSetting)
|
timeout=(timeoutSetting)
|
||||||
)
|
)
|
||||||
|
|
||||||
mylog('verbose', ['[SNMPDSC] output: ', output])
|
mylog('verbose', [f"[{pluginName}] output: ", output])
|
||||||
|
|
||||||
lines = output.split('\n')
|
lines = output.split('\n')
|
||||||
|
|
||||||
@@ -80,6 +80,8 @@ def main():
|
|||||||
|
|
||||||
tmpSplt = line.split('"')
|
tmpSplt = line.split('"')
|
||||||
|
|
||||||
|
# Expected Format:
|
||||||
|
# mib-2.3.1.1.2.15.1.192.168.1.14 "2C F4 32 18 61 43 "
|
||||||
if len(tmpSplt) == 3:
|
if len(tmpSplt) == 3:
|
||||||
|
|
||||||
ipStr = tmpSplt[0].split('.')[-4:] # Get the last 4 elements to extract the IP
|
ipStr = tmpSplt[0].split('.')[-4:] # Get the last 4 elements to extract the IP
|
||||||
@@ -89,7 +91,7 @@ def main():
|
|||||||
macAddress = ':'.join(macStr)
|
macAddress = ':'.join(macStr)
|
||||||
ipAddress = '.'.join(ipStr)
|
ipAddress = '.'.join(ipStr)
|
||||||
|
|
||||||
mylog('verbose', [f'[SNMPDSC] IP: {ipAddress} MAC: {macAddress}'])
|
mylog('verbose', [f"[{pluginName}] IP: {ipAddress} MAC: {macAddress}"])
|
||||||
|
|
||||||
plugin_objects.add_object(
|
plugin_objects.add_object(
|
||||||
primaryId = handleEmpty(macAddress),
|
primaryId = handleEmpty(macAddress),
|
||||||
@@ -100,8 +102,40 @@ def main():
|
|||||||
foreignKey = handleEmpty(macAddress) # Use the primary ID as the foreign key
|
foreignKey = handleEmpty(macAddress) # Use the primary ID as the foreign key
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
mylog('verbose', ['[SNMPDSC] ipStr does not seem to contain a valid IP:', ipStr])
|
mylog('verbose', [f"[{pluginName}] ipStr does not seem to contain a valid IP:", ipStr])
|
||||||
|
|
||||||
|
# Expected Format:
|
||||||
|
# IP-MIB::ipNetToMediaPhysAddress.17.10.10.3.202 = STRING: f8:81:1a:ef:ef:ef
|
||||||
|
elif "ipNetToMediaPhysAddress" in line and "=" in line and "STRING:" in line:
|
||||||
|
|
||||||
|
# Split on "=" → ["IP-MIB::ipNetToMediaPhysAddress.xxx.xxx.xxx.xxx ", " STRING: aa:bb:cc:dd:ee:ff"]
|
||||||
|
left, right = line.split("=", 1)
|
||||||
|
|
||||||
|
# Extract the MAC (right side)
|
||||||
|
macAddress = right.split("STRING:")[-1].strip()
|
||||||
|
macAddress = normalize_mac(macAddress)
|
||||||
|
|
||||||
|
# Extract IP address from the left side
|
||||||
|
# tail of the OID: last 4 integers = IPv4 address
|
||||||
|
oid_parts = left.strip().split('.')
|
||||||
|
ip_parts = oid_parts[-4:]
|
||||||
|
ipAddress = ".".join(ip_parts)
|
||||||
|
|
||||||
|
mylog('verbose', [f"[{pluginName}] (fallback) IP: {ipAddress} MAC: {macAddress}"])
|
||||||
|
|
||||||
|
plugin_objects.add_object(
|
||||||
|
primaryId = handleEmpty(macAddress),
|
||||||
|
secondaryId = handleEmpty(ipAddress),
|
||||||
|
watched1 = '(unknown)',
|
||||||
|
watched2 = handleEmpty(snmpwalkArgs[6]),
|
||||||
|
extra = handleEmpty(line),
|
||||||
|
foreignKey = handleEmpty(macAddress)
|
||||||
|
)
|
||||||
|
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Expected Format:
|
||||||
|
# ipNetToMediaPhysAddress[3][192.168.1.9] 6C:6C:6C:6C:6C:b6C1
|
||||||
elif line.startswith('ipNetToMediaPhysAddress'):
|
elif line.startswith('ipNetToMediaPhysAddress'):
|
||||||
# Format: snmpwalk -OXsq output
|
# Format: snmpwalk -OXsq output
|
||||||
parts = line.split()
|
parts = line.split()
|
||||||
@@ -110,7 +144,7 @@ def main():
|
|||||||
ipAddress = parts[0].split('[')[-1][:-1]
|
ipAddress = parts[0].split('[')[-1][:-1]
|
||||||
macAddress = normalize_mac(parts[1])
|
macAddress = normalize_mac(parts[1])
|
||||||
|
|
||||||
mylog('verbose', [f'[SNMPDSC] IP: {ipAddress} MAC: {macAddress}'])
|
mylog('verbose', [f"[{pluginName}] IP: {ipAddress} MAC: {macAddress}"])
|
||||||
|
|
||||||
plugin_objects.add_object(
|
plugin_objects.add_object(
|
||||||
primaryId = handleEmpty(macAddress),
|
primaryId = handleEmpty(macAddress),
|
||||||
@@ -121,7 +155,7 @@ def main():
|
|||||||
foreignKey = handleEmpty(macAddress)
|
foreignKey = handleEmpty(macAddress)
|
||||||
)
|
)
|
||||||
|
|
||||||
mylog('verbose', ['[SNMPDSC] Entries found: ', len(plugin_objects)])
|
mylog('verbose', [f"[{pluginName}] Entries found: ", len(plugin_objects)])
|
||||||
|
|
||||||
plugin_objects.write_result_file()
|
plugin_objects.write_result_file()
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from database import DB # noqa: E402 [flake8 lint suppression]
|
|
||||||
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
from models.device_instance import DeviceInstance # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
|
|
||||||
@@ -44,12 +43,8 @@ def main():
|
|||||||
|
|
||||||
mylog('verbose', [f'[{pluginName}] broadcast_ips value {broadcast_ips}'])
|
mylog('verbose', [f'[{pluginName}] broadcast_ips value {broadcast_ips}'])
|
||||||
|
|
||||||
# Create a database connection
|
|
||||||
db = DB() # instance of class DB
|
|
||||||
db.open()
|
|
||||||
|
|
||||||
# Create a DeviceInstance instance
|
# Create a DeviceInstance instance
|
||||||
device_handler = DeviceInstance(db)
|
device_handler = DeviceInstance()
|
||||||
|
|
||||||
# Retrieve devices
|
# Retrieve devices
|
||||||
if 'offline' in devices_to_wake:
|
if 'offline' in devices_to_wake:
|
||||||
|
|||||||
@@ -425,7 +425,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -578,7 +578,17 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
|||||||
setType = set["setType"]
|
setType = set["setType"]
|
||||||
setCodeName = set["setKey"]
|
setCodeName = set["setKey"]
|
||||||
|
|
||||||
settingsArray = collectSetting(prefix, setCodeName, setType, settingsArray)
|
// settingsArray = collectSetting(prefix, setCodeName, setType, settingsArray)
|
||||||
|
const collectSettingResult = collectSetting(prefix, setCodeName, setType, settingsArray);
|
||||||
|
settingsArray = collectSettingResult.settingsArray;
|
||||||
|
|
||||||
|
if (!collectSettingResult.dataIsValid) {
|
||||||
|
msg = getString("Gen_Invalid_Value") + ": " + collectSettingResult.failedSettingKey;
|
||||||
|
console.error(msg);
|
||||||
|
showMessage (msg, 3000, "modal_red");
|
||||||
|
// return early
|
||||||
|
return;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// sanity check to make sure settings were loaded & collected correctly
|
// sanity check to make sure settings were loaded & collected correctly
|
||||||
@@ -586,6 +596,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
|||||||
{
|
{
|
||||||
|
|
||||||
console.log(settingsArray);
|
console.log(settingsArray);
|
||||||
|
console.log(settingsJSON_DB);
|
||||||
console.log( JSON.stringify(settingsArray));
|
console.log( JSON.stringify(settingsArray));
|
||||||
// return; // 🐛 🔺
|
// return; // 🐛 🔺
|
||||||
// trigger a save settings event in the backend
|
// trigger a save settings event in the backend
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user