./deployment/run_analytics.sh hourly
 Esecuzione aggregazione hourly...
[ANALYTICS] Aggregazione oraria: 2025-11-24 09:00
[ANALYTICS] ✅ Aggregazione completata:
  - Totale: 7182065 pacchetti, 27409 IP unici
  - Normale: 6922072 pacchetti (96%)
  - Attacchi: 259993 pacchetti (3%), 15 IP
✅ Aggregazione hourly completata!
[root@ids ids]# ./deployment/restart_frontend.sh
 Restart Frontend Node.js...
⏸  Stopping existing processes...
 Starting frontend...
❌ Errore: Frontend non avviato!
 Controlla log: tail -f /var/log/ids/frontend.log
[root@ids ids]# curl -s http://localhost:5000/api/analytics/recent?days=7&hourly=true | jq '. | length'
[1] 59354
[root@ids ids]# echo "=== DIAGNOSTICA IDS ANALYTICS ===" > /tmp/ids_diagnostic.txtxt
echo "" >> /tmp/ids_diagnostic.txt
[1]+  Done                    curl -s http://localhost:5000/api/analytics/recent?days=7
[root@ids ids]# tail -f /var/log/ids/frontend.log
[Mon Nov 24 10:15:13 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:15:15 CET 2025] Frontend riavviato con PID: 59307

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
10:15:17 AM [express] serving on port 5000
✅ Database connection successful
10:15:34 AM [express] GET /api/analytics/recent 200 in 32ms :: []
[Mon Nov 24 10:20:01 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:20:03 CET 2025] Frontend riavviato con PID: 59406

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:25:02 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:25:04 CET 2025] Frontend riavviato con PID: 59511

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:30:01 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:30:03 CET 2025] Frontend riavviato con PID: 59618

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:35:01 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:35:03 CET 2025] Frontend riavviato con PID: 59725

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:40:02 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:40:04 CET 2025] Frontend riavviato con PID: 59831

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:45:02 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:45:04 CET 2025] Frontend riavviato con PID: 59935

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:50:01 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:50:03 CET 2025] Frontend riavviato con PID: 60044

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts

 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
[Mon Nov 24 10:55:01 CET 2025] Frontend Node NON attivo, riavvio...
[Mon Nov 24 10:55:03 CET 2025] Frontend riavviato con PID: 60151

> rest-express@1.0.0 dev
> NODE_ENV=development tsx server/index.ts


A PostCSS plugin did not pass the `from` option to `postcss.parse`. This may cause imported assets to be incorrectly transformed. If you've recently added a PostCSS plugin that raised this warning, please contact the package author to fix the issue.
🐘 Using standard PostgreSQL database
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 0.0.0.0:5000
    at Server.setupListenHandle [as _listen2] (node:net:1908:16)
    at listenInCluster (node:net:1965:12)
    at doListen (node:net:2139:7)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1944:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 5000
}

Node.js v20.19.5
10:55:06 AM [express] GET /api/logs/[object%20Object] 200 in 10ms
10:55:06 AM [express] GET /api/detections 200 in 34ms :: [{"id":"5659c0b5-11df-4ebe-b73f-f53c64932953…
10:55:08 AM [express] GET /api/analytics/recent/[object%20Object] 200 in 7ms
10:55:11 AM [express] GET /api/analytics/recent/[object%20Object] 200 in 5ms
10:55:12 AM [express] GET /api/analytics/recent/[object%20Object] 200 in 5ms
                                                                                 