How pavanmajhi05-sys/cloud-linux-anomaly-detection works
Cloud Linux AI Monitor collects Linux resource metrics, derives network and disk-I/O rates, classifies anomalies with an Isolation Forest, assigns severity, and stores results for API and dashboard display. The documented flow is represented by the monitoring agent, prediction, SQLite, REST API, and React dashboard; a separate service also performs on-demand predictions, but the excerpts do not show it wired to an API route. Training and experiment modules and the optional CSV logger are included as distinct capabilities. Relationships reflect shown calls or README documentation; unsampled integrations are not inferred.
Main entry points: ml_agent.py Monitoring Agent · predict.py Feature Prediction · routes.py Monitoring Routes · metrics.py Metric Collector
Components 16
Metric Collection
- Monitoring Agent
monitoring/ml_agent.py - Metric Collector
monitoring/metrics.py - CSV Logger
monitoring/logger.py - CSV Collection Agent
monitoring/collector.py
Anomaly Detection
- Prediction Service
backend/services/prediction_service.py - Feature Prediction
ml/predict.py - Severity Scoring
ml/severity.py - Model Training
ml/train.py - Isolation Forest Model
ml/model/isolation_forest_clean.joblib
Result Storage
- Database Setup
backend/database/database.py - Monitoring Results
backend/database/database.py
REST API
- Monitoring Routes
backend/api/routes.py - FastAPI Application
backend/main.py
Dashboard
- React Entry
frontend/react-dashboard/src/main.jsx - Dashboard UI
frontend/react-dashboard/src/App.jsx
Other components
- Linux Server
Connections 19
- Linux Server → Metric Collector: provides metrics
README.md - Monitoring Agent → Metric Collector: collects snapshots
monitoring/ml_agent.py - Monitoring Agent → Feature Prediction: requests prediction
monitoring/ml_agent.py - Monitoring Agent → Database Setup: initializes store
monitoring/ml_agent.py - Monitoring Agent → Monitoring Results: saves results
monitoring/ml_agent.py - CSV Collection Agent → Metric Collector: collects readings
monitoring/collector.py - CSV Collection Agent → CSV Logger: logs readings
monitoring/collector.py - Prediction Service → Metric Collector: collects snapshots
backend/services/prediction_service.py - Prediction Service → Feature Prediction: requests prediction
backend/services/prediction_service.py - Prediction Service → Monitoring Results: saves results
backend/services/prediction_service.py - Feature Prediction → Severity Scoring: scores anomalies
ml/predict.py - Feature Prediction → Isolation Forest Model: loads model
ml/predict.py - Model Training → Isolation Forest Model: produces model
- FastAPI Application → Database Setup: initializes store
backend/main.py - FastAPI Application → Monitoring Routes: registers routes
backend/main.py - Monitoring Routes → Monitoring Results: queries records
backend/api/routes.py - React Entry → Dashboard UI: renders app
frontend/react-dashboard/src/main.jsx - Dashboard UI → Monitoring Routes: requests prediction
frontend/react-dashboard/src/App.jsx - Dashboard UI → Monitoring Routes: requests history
frontend/react-dashboard/src/App.jsx