
 Status Servizi:
● ids-ml-backend.service - IDS ML Backend (FastAPI)
     Loaded: loaded (/etc/systemd/system/ids-ml-backend.service; enabled; preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2025-11-22 10:55:17 CET; 348ms ago
    Process: 15380 ExecStart=/opt/ids/python_ml/venv/bin/python3 main.py (code=exited, status=1/FAILURE)
   Main PID: 15380 (code=exited, status=1/FAILURE)
        CPU: 3.435s

● ids-syslog-parser.service - IDS Syslog Parser (Network Logs Processor)
     Loaded: loaded (/etc/systemd/system/ids-syslog-parser.service; enabled; preset: disabled)
     Active: active (running) since Sat 2025-11-22 10:55:15 CET; 2s ago
   Main PID: 15405 (python3)
      Tasks: 1 (limit: 100409)
     Memory: 10.7M (max: 1.0G available: 1013.2M)
        CPU: 324ms
     CGroup: /system.slice/ids-syslog-parser.service
             └─15405 /opt/ids/python_ml/venv/bin/python3 syslog_parser.py


╔═══════════════════════════════════════════════╗
║   ✅ SYSTEMD SERVICES CONFIGURATI              ║
╚═══════════════════════════════════════════════╝

 COMANDI UTILI:
   systemctl status ids-ml-backend       - Status ML Backend
   systemctl status ids-syslog-parser    - Status Syslog Parser
   systemctl restart ids-ml-backend      - Restart ML Backend
   systemctl restart ids-syslog-parser   - Restart Syslog Parser
   journalctl -u ids-ml-backend -f       - Log ML Backend
   journalctl -u ids-syslog-parser -f    - Log Syslog Parser

[root@ids ids]# # Verifica status servizi
systemctl status ids-ml-backend
systemctl status ids-syslog-parser

# Entrambi dovrebbero mostrare "Active: active (running)"
● ids-ml-backend.service - IDS ML Backend (FastAPI)
     Loaded: loaded (/etc/systemd/system/ids-ml-backend.service; enabled; preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2025-11-22 10:55:17 CET; 4s ago
    Process: 15380 ExecStart=/opt/ids/python_ml/venv/bin/python3 main.py (code=exited, status=1/FAILURE)
   Main PID: 15380 (code=exited, status=1/FAILURE)
        CPU: 3.435s
● ids-syslog-parser.service - IDS Syslog Parser (Network Logs Processor)
     Loaded: loaded (/etc/systemd/system/ids-syslog-parser.service; enabled; preset: disabled)
     Active: active (running) since Sat 2025-11-22 10:55:15 CET; 5s ago
   Main PID: 15405 (python3)
      Tasks: 1 (limit: 100409)
     Memory: 10.7M (max: 1.0G available: 1013.2M)
        CPU: 627ms
     CGroup: /system.slice/ids-syslog-parser.service
             └─15405 /opt/ids/python_ml/venv/bin/python3 syslog_parser.py

Nov 22 10:55:15 ids.alfacom.it systemd[1]: Started IDS Syslog Parser (Network Logs Processor).
[root@ids ids]# systemctl status ids-syslog-parser
● ids-syslog-parser.service - IDS Syslog Parser (Network Logs Processor)
     Loaded: loaded (/etc/systemd/system/ids-syslog-parser.service; enabled; preset: disabled)
     Active: active (running) since Sat 2025-11-22 10:55:15 CET; 14s ago
   Main PID: 15405 (python3)
      Tasks: 1 (limit: 100409)
     Memory: 10.8M (max: 1.0G available: 1013.1M)
        CPU: 1.268s
     CGroup: /system.slice/ids-syslog-parser.service
             └─15405 /opt/ids/python_ml/venv/bin/python3 syslog_parser.py

Nov 22 10:55:15 ids.alfacom.it systemd[1]: Started IDS Syslog Parser (Network Logs Processor).
[root@ids ids]# systemctl status ids-ml-backend
● ids-ml-backend.service - IDS ML Backend (FastAPI)
     Loaded: loaded (/etc/systemd/system/ids-ml-backend.service; enabled; preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2025-11-22 10:55:29 CET; 7s ago
    Process: 15441 ExecStart=/opt/ids/python_ml/venv/bin/python3 main.py (code=exited, status=1/FAILURE)
   Main PID: 15441 (code=exited, status=1/FAILURE)
        CPU: 3.642s
[root@ids ids]# systemctl restart ids-ml-backend
[root@ids ids]# systemctl status ids-ml-backend
● ids-ml-backend.service - IDS ML Backend (FastAPI)
     Loaded: loaded (/etc/systemd/system/ids-ml-backend.service; enabled; preset: disabled)
     Active: active (running) since Sat 2025-11-22 10:55:48 CET; 1s ago
   Main PID: 15482 (python3)
      Tasks: 15 (limit: 100409)
     Memory: 110.1M (max: 2.0G available: 1.8G)
        CPU: 3.357s
     CGroup: /system.slice/ids-ml-backend.service
             └─15482 /opt/ids/python_ml/venv/bin/python3 main.py

Nov 22 10:55:48 ids.alfacom.it systemd[1]: Started IDS ML Backend (FastAPI).
[root@ids ids]# systemctl status ids-ml-backend
● ids-ml-backend.service - IDS ML Backend (FastAPI)
     Loaded: loaded (/etc/systemd/system/ids-ml-backend.service; enabled; preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2025-11-22 10:55:50 CET; 3s ago
    Process: 15482 ExecStart=/opt/ids/python_ml/venv/bin/python3 main.py (code=exited, status=1/FAILURE)
   Main PID: 15482 (code=exited, status=1/FAILURE)
        CPU: 3.607s
[root@ids ids]# tail -30 /var/log/ids/ml_backend.log
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 21, in <module>
    from mikrotik_manager import MikroTikManager
  File "/opt/ids/python_ml/mikrotik_manager.py", line 6, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 21, in <module>
    from mikrotik_manager import MikroTikManager
  File "/opt/ids/python_ml/mikrotik_manager.py", line 6, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 21, in <module>
    from mikrotik_manager import MikroTikManager
  File "/opt/ids/python_ml/mikrotik_manager.py", line 6, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 21, in <module>
    from mikrotik_manager import MikroTikManager
  File "/opt/ids/python_ml/mikrotik_manager.py", line 6, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'
Traceback (most recent call last):
  File "/opt/ids/python_ml/main.py", line 21, in <module>
    from mikrotik_manager import MikroTikManager
  File "/opt/ids/python_ml/mikrotik_manager.py", line 6, in <module>
    import httpx
ModuleNotFoundError: No module named 'httpx'