ids.alfacom.it/attached_assets/Pasted-systemctl-status-ids-ml-backend-Unit-ids-ml-backend-service-could-not-be-found-root-ids-ps-aux-1763802707490_1763802707490.txt
marco370 4a2d7f9c5c Add service monitoring and status indicators to the dashboard
Introduce a new services page, integrate real-time status monitoring for ML backend, database, and syslog parser, and update the dashboard to display service health indicators.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: cde95c60-908b-48a0-b7b9-38e5e924b3b3
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/n4Q2eeE
2025-11-22 09:24:10 +00:00

76 lines
3.3 KiB
Plaintext

systemctl status ids-ml-backend
Unit ids-ml-backend.service could not be found.
[root@ids ~]# ps aux | grep "python.*main.py"
ids 1547 6.0 4.1 2205816 668884 ? Sl Nov21 55:37 /usr/bin/python3.11 main.py
root 13688 0.0 0.0 3884 2304 pts/5 S+ 10:08 0:00 grep --color=auto python.*main.py
[root@ids ~]# tail -50 /var/log/ids/ml_backend.log
tail: cannot open '/var/log/ids/ml_backend.log' for reading: No such file or directory
[root@ids ~]# curl http://localhost:8000/health
{"status":"healthy","database":"connected","ml_model":"loaded","timestamp":"2025-11-22T10:09:55.941962"}[root@ids ~]#
[root@ids ~]# sudo crontab -u ids -l | grep train
0 */12 * * * /opt/ids/deployment/cron_train.sh
[root@ids ~]# # Verifica storico training
psql $DATABASE_URL -c "SELECT id, model_version, records_processed, status, notes, trained_at FROM training_history ORDER BY trained_at DESC LIMIT 5;"
psql: error: FATAL: role "root" does not exist
[root@ids ~]# cd /opt/ids/
[root@ids ids]# cat .env
# Database PostgreSQL
PGHOST=localhost
PGPORT=5432
PGDATABASE=ids_database
PGUSER=ids_user
PGPASSWORD=TestPassword123
DATABASE_URL=postgresql://ids_user:TestPassword123@127.0.0.1:5432/ids_database
# Session Secret (genera una stringa random sicura)
SESSION_SECRET=zLMzP8lLgjgz/NlgfDXuLK8bwHCod+o5zLOWP5DipRM=
# Python Backend URL (per frontend)
VITE_PYTHON_API_URL=http://localhost:8000
# Node Environment
NODE_ENV=production
[root@ids ids]# DATABASE_URL=postgresql://ids_user:TestPassword123@127.0.0.1:5432/ids_database
[root@ids ids]# cat .env
# Database PostgreSQL
PGHOST=localhost
PGPORT=5432
PGDATABASE=ids_database
PGUSER=ids_user
PGPASSWORD=TestPassword123
DATABASE_URL=postgresql://ids_user:TestPassword123@127.0.0.1:5432/ids_database
# Session Secret (genera una stringa random sicura)
SESSION_SECRET=zLMzP8lLgjgz/NlgfDXuLK8bwHCod+o5zLOWP5DipRM=
# Python Backend URL (per frontend)
VITE_PYTHON_API_URL=http://localhost:8000
# Node Environment
NODE_ENV=production
[root@ids ids]# psql $DATABASE_URL -c "SELECT id, model_version, records_processed, status, notes, trained_at FROM training_history ORDER BY trained_at DESC LIMIT 5;"
id | model_version | records_processed | status | notes | trained_at
----+---------------+-------------------+--------+-------+------------
(0 rows)
[root@ids ids]# # Trova dove sta loggando il processo
lsof -p 1547 | grep log
python3.1 1547 ids mem REG 253,0 187881 1053730 /home/ids/.local/lib/python3.11/site-packages/sklearn/utils/_logistic_sigmoid.cpython-311-x86_64-linux-gnu.so
python3.1 1547 ids 1w REG 253,0 1546719 538992839 /var/log/ids/backend.log
python3.1 1547 ids 2w REG 253,0 1546719 538992839 /var/log/ids/backend.log
[root@ids ids]# tail -f /var/log/ids/backend.log
📚 Docs available at http://0.0.0.0:8000/docs
INFO: 127.0.0.1:40168 - "POST /detect HTTP/1.1" 200 OK
INFO: 127.0.0.1:57698 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:56726 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:41940 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:39840 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:55900 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:43422 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:33580 - "GET /stats HTTP/1.1" 200 OK
INFO: 127.0.0.1:55752 - "GET /stats HTTP/1.1" 200 OK
^C