From d3e8e51043044f2336b46e9fb8eea86cfe153506 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Mon, 5 Jan 2026 18:51:42 +0100 Subject: [PATCH] fix(luci-app-secubox-netifyd): Read netifyd native status.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Netifyd crée automatiquement /var/run/netifyd/status.json avec toutes les stats. Pas besoin de collecteur custom ! Changements: - Lit flow_count directement depuis le fichier natif - Compte unique_devices depuis la table ARP (ip neigh) - Lit dns_hint_cache.cache_size pour applications - Calcule total_bytes depuis stats.*.wire_bytes Fix testé sur routeur: - active_flows: 16 ✓ - unique_devices: 4 ✓ - unique_applications: 5 ✓ - total_bytes: 48302 ✓ Le collecteur n'est plus nécessaire - netifyd gère tout ! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../root/usr/libexec/rpcd/luci.secubox-netifyd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-secubox-netifyd/root/usr/libexec/rpcd/luci.secubox-netifyd b/package/secubox/luci-app-secubox-netifyd/root/usr/libexec/rpcd/luci.secubox-netifyd index e5ae0245..add07160 100755 --- a/package/secubox/luci-app-secubox-netifyd/root/usr/libexec/rpcd/luci.secubox-netifyd +++ b/package/secubox/luci-app-secubox-netifyd/root/usr/libexec/rpcd/luci.secubox-netifyd @@ -421,11 +421,17 @@ get_dashboard() { json_add_object "stats" if [ -f "$NETIFYD_STATUS" ] && command -v jq >/dev/null 2>&1; then - # Use actual data from status.json + # Use actual data from netifyd's native status.json local total_flows=$(jq -r '.flow_count // 0' "$NETIFYD_STATUS" 2>/dev/null || echo 0) - local unique_devices=$(jq -r '.device_count // 0' "$NETIFYD_STATUS" 2>/dev/null || echo 0) - local dhc_size=$(jq -r '.dhc_size // 0' "$NETIFYD_STATUS" 2>/dev/null || echo 0) - local total_bytes=$(jq -r '.total_bytes // 0' "$NETIFYD_STATUS" 2>/dev/null || echo 0) + + # Count unique devices from ARP table + local unique_devices=$(ip neigh show 2>/dev/null | grep -c "REACHABLE\|STALE\|DELAY" || echo 0) + + # Get DHC size (detection hash cache - unique applications) + local dhc_size=$(jq -r '.dns_hint_cache.cache_size // 0' "$NETIFYD_STATUS" 2>/dev/null || echo 0) + + # Calculate total bytes from all interface stats + local total_bytes=$(jq -r '[.stats | to_entries[] | .value.wire_bytes // 0] | add' "$NETIFYD_STATUS" 2>/dev/null || echo 0) json_add_int "active_flows" "$total_flows" json_add_int "unique_devices" "$unique_devices"