Commit Graph
46 Commits
Author SHA1 Message Date
jokob-sk 4a60a04e0d BE: stricter name resoltion #1731 2026-11-02 00:14:38 +11:00
jokob-sk 129ac8133b Merge branch 'next_release' of github.com:netalertx/NetAlertX into next_release 2026-11-01 23:24:10 +11:00
jokob-sk 03911713bb BE: watched fields notification fix #1865 2026-11-01 23:23:54 +11:00
Jokob @NetAlertX ce971aba45 Merge pull request #1869 from sebingel/fix/piholeapi-presence
PIHOLEAPI: use lastQuery for online status, do not mark offline imports as present
2026-11-01 21:09:14 +09:00
jokob-sk 2b956866b8 BE: performance charts fix #1866 2026-11-01 22:56:45 +11:00
sebingel 98f5b81cc8 marks PIHOLEAPI rows of offline devices as not present
With PIHOLEAPI_GET_OFFLINE enabled, PIHOLEAPI imports devices it considers
offline, but every row still counted as a live sighting. The plugin
computed the online state, yet never passed it on, and its config.json
mapped nothing to CurrentScan.scanPresence, so each row got the column
default 1. An offline device imported only for its name, vendor and IP
was marked online. ADGUARDIMP had the same problem in #1813 and fixed it
the same way.

Changes:
- main() passes the online state as helpVal4 '1' or '0' to add_object()
  (server/plugins/pihole_api_scan/pihole_api_scan.py).
- config.json maps helpVal4 to scanPresence, the same column definition
  adguard_import uses. The GET_OFFLINE description says offline devices
  are imported without being marked online; the README says the same.
- test/db_test_helpers.py: make_plugin_event_row() takes an optional
  help_val4, and CREATE_CURRENT_SCAN gets the
  CHECK (scanPresence IN (0, 1)) of the real schema (db_upgrade.py), so a
  test sees the same constraint as production.
- New test/scan/test_piholeapi_scan_presence_mapping.py runs the real
  PIHOLEAPI config.json through process_plugin_events() and checks that a
  helpVal4 '0' row lands in CurrentScan with scanPresence 0.
- test/plugins/test_pihole_api_scan.py: main() writes helpVal4 '0' for an
  offline device and '1' for every IP row of an online device. Both new
  tests fail without this change.

Impact:
Devices imported only because of PIHOLEAPI_GET_OFFLINE keep their name,
vendor and IP data but no longer mark the device as online. Live check
against Pi-hole v6.8: 28 rows with helpVal4 '0', 5 with '1'; the absent
phone got devPresentLastScan 0 and only a New Device event. With
GET_OFFLINE disabled (the default) every imported row is online, so
nothing changes there.
2026-11-01 09:29:50 +00:00
jokob-sk ce6914beaf FE+TESTS: review fixes 2026-10-10 09:22:04 +11:00
jokob-sk c25fd5f6af DOS+BE: skill updates + multi ip handling #1831 2026-10-10 08:45:53 +11:00
jokob-sk 06d9ae9613 BE: Fix: NIC-Covered Parent Devices Miss Connected/Down Reconnected Events #1821 2026-10-01 07:41:17 +10:00
jokob-sk fbbdefb898 BE: Fix: NIC-Covered Parent Devices Miss Connected/Down Reconnected Events #1821 2026-09-30 22:01:04 +10:00
jokob-sk b18fc0688a BE: Fix: NIC-Covered Parent Devices Miss Connected/Down Reconnected Events #1821 2026-09-30 21:33:33 +10:00
jokob-sk 4f7448b3c9 BE: NICs presence fixes orphan disconnect events for parent #1821 2026-09-30 07:53:07 +10:00
jokob-sk 0d60071d49 BE+FE: System info -> Performance section 2026-09-28 21:32:16 +10:00
jokob-sk 4aa2a0dddb BE+FE: System info -> Performance section 2026-09-28 14:40:11 +10:00
jokob-sk f0a833ccc8 BE: docstrings 2026-09-28 07:44:29 +10:00
jokob-sk fa5c62c9c3 BE: Stats Logging for Down Devices corrected #1818 2026-09-28 07:27:06 +10:00
jokob-sk 7aca7c17f3 BE: FREEBOX dual stack IP fix #1804 2026-09-23 08:17:23 +10:00
jokob-sk 24301cbdbc BE: FREEBOX dual stack IP fix #1804 2026-09-23 07:52:30 +10:00
jokob-sk a573eeb0e7 BE: FREEBOX dual stack IP fix #1804 2026-09-22 08:43:41 +10:00
jokob-sk dc7274a2e9 DOCS: skill cleanup, lower case mac fixes, trigger performance 2026-09-14 14:26:14 +10:00
jokob-sk 37bf86a805 BE: conditional device import support, notification supression support during scan #1721 2026-09-11 08:26:16 +10:00
jokob-sk 6dab348de2 BE: conditional device import support, notification supression support during scan #1721 2026-09-11 08:01:41 +10:00
jokob-sk dd4fc057c8 BE: SQL refactor presence 2026-09-10 22:11:46 +10:00
jokob-sk de730e85e9 BE: conditional device import support, notification supression support during scan #1721 2026-09-10 18:41:07 +10:00
jokob-sk 34993ed77b BE: conditional device import support, notification supression support during scan #1721 2026-09-10 17:40:31 +10:00
jokob-sk 44c52a3cf4 BE: conditional device import support, notification supression support during scan #1721 2026-09-10 14:27:44 +10:00
jokob-sk c3bdd92b8d BE: conditional device import support, notification supression support during scan #1721 2026-09-10 13:51:09 +10:00
Jokob @NetAlertX 7a8ea5d829 feat(database): add cleanup for dangling parentMAC references and related tests 2026-08-21 23:22:40 +00:00
copilot-swe-agent[bot]andjokob-sk f52cc50705 fix: address review feedback on NIC presence logic and tests
- Replace max() with explicit if/else for readability
- Use db_test_helpers (make_db, make_device_dict, insert_device_from_dict,
  DummyDB) instead of local mock DB objects in test_nic_presence.py
- Lowercase all MAC addresses in tests

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:52:43 +00:00
copilot-swe-agent[bot]andjokob-sk 283bea21c9 fix: NIC child presence no longer forces a directly-detected parent offline
When a parent device has NIC children, update_devPresentLastScan_based_on_nics
previously replaced the parent's devPresentLastScan unconditionally with the
NIC-derived value. This discarded any genuine direct detection of the parent:
if the parent was found by ARP/save_own_device (present=1) but its NIC child
was absent (present=0), the NIC step forced the parent back to 0. The next
scan re-detected the parent → Connected event → NIC forced it down again,
producing an endless one-directional Connected event stream.

Fix: use max(original, nic_derived) so NIC children can only raise a parent's
presence (bring an undetected parent online), never lower it when the parent
itself was directly detected this cycle.

Adds test/scan/test_nic_presence.py covering the exact regression scenario
and surrounding cases (raise, no-NIC unchanged, req_all modes).

Fixes #1736

Co-authored-by: jokob-sk <96159884+jokob-sk@users.noreply.github.com>
2026-08-13 08:44:00 +00:00
Jokob @NetAlertX 9e38cfd8b4 Add website monitoring plugin and update workflows configuration
- Introduced a new plugin for monitoring website health, including functionality to check URLs and log results.
- Created README and configuration files for the workflows plugin, detailing its purpose and settings.
- Updated import paths in various test files to reflect the new directory structure.
- Ensured compatibility of test cases with the updated plugin architecture.
2026-08-10 02:32:49 +00:00
jokob-sk 7630608583 docs 2026-06-19 22:39:09 +00:00
Jokob @NetAlertX f9bd8f35f5 Refactor test_sync_hub_node_backfill: streamline imports and utilize shared DB helpers 2026-04-15 12:48:01 +00:00
Jokob @NetAlertX 89139fed60 Add update_sync_hub_node function and corresponding tests for backfilling devSyncHubNode #1609 2026-04-14 20:59:36 +00:00
Jokob @NetAlertX 50be56c8bb PLG: Enhance device event handling for forced-online status #1602 2026-04-10 21:44:03 +00:00
Jokob @NetAlertX c7399215ec Refactor event and session column names to camelCase
- Updated test cases to reflect new column names (eve_MAC -> eveMac, eve_DateTime -> eveDateTime, etc.) across various test files.
- Modified SQL table definitions in the database cleanup and migration tests to use camelCase naming conventions.
- Implemented migration tests to ensure legacy column names are correctly renamed to camelCase equivalents.
- Ensured that existing data is preserved during the migration process and that views referencing old column names are dropped before renaming.
- Verified that the migration function is idempotent, allowing for safe re-execution without data loss.
2026-03-16 10:11:22 +00:00
Jokob @NetAlertX 3a73817048 Enhance device down event handling for sleeping devices and improve down alerts query 2026-03-02 10:05:37 +00:00
Jokob @NetAlertX 15807b7ab9 Add unit and integration tests for device down event handling and sleeping suppression 2026-03-02 05:53:28 +00:00
jokob-sk 8538c87fef FIX: lowercase MAC normalization across project v0.3
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-07 14:08:14 +11:00
jokob-sk 827b5d2ad3 FIX: lowercase MAC normalization across project v0.2
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-07 14:02:54 +11:00
jokob-sk 6bc2de6e24 TEST: scan processing - de;eted
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:54:15 +11:00
jokob-sk 09b42166cc TEST: scan processing 9
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:48:40 +11:00
jokob-sk dbe490a042 TEST: scan processing 8
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:43:53 +11:00
jokob-sk 5996e70f60 TEST: scan processing 7
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:39:08 +11:00
jokob-sk 15366a7f2e TEST: scan processing 6 + css fixes
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:34:25 +11:00
jokob-sk d5d1684ef9 TEST: scan processing 5
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2026-02-06 18:21:24 +11:00