Skip to content

NYN-05/System-Monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System Monitoring and Forecasting

Overview

This project provides a system monitoring and forecasting solution. It consists of two main components:

  1. Sys.py: A real-time system monitoring script that collects system metrics such as CPU usage, memory usage, disk usage, GPU load, and more. The data is logged continuously into a CSV file (system_monitoring.csv).

  2. ML.py: A machine learning script that loads the collected system monitoring data, performs time series forecasting on key system metrics (CPU, memory, disk usage, and RAM), visualizes the forecasts, and generates prioritized suggestions based on predicted system performance trends using natural language processing techniques.

Files Description

  • Sys.py:

    • Collects system information every 5 seconds using libraries like psutil and GPUtil.
    • Logs data including timestamp, platform details, CPU usage, memory usage, disk usage, GPU info, and GPU load into system_monitoring.csv.
    • Designed to run continuously until manually stopped.
  • ML.py:

    • Loads and preprocesses the system_monitoring.csv data.
    • Uses time series forecasting models such as ARIMA (with optional pmdarima for automatic order selection) or exponential smoothing for small datasets.
    • Visualizes historical data and forecasts with confidence intervals.
    • Generates system health suggestions using sentiment analysis (TextBlob) and optionally transformer-based text generation (transformers library).
    • Provides insights and warnings based on forecasted system metrics exceeding data-driven thresholds.
  • system_monitoring.csv:

    • The CSV file where system metrics are logged by Sys.py.
    • Used as input data for forecasting and analysis in ML.py.
  • requirements.txt:

    • Lists all Python dependencies required to run the monitoring and forecasting scripts.

Installation

  1. Clone or download this repository.

  2. Install the required Python packages using pip:

    pip install -r requirements.txt

    Note: Some packages like pmdarima and transformers are optional but recommended for improved forecasting and suggestion generation.

Usage

Running System Monitoring

Run the Sys.py script to start collecting system metrics in real-time:

python Sys.py

This will create or append to the system_monitoring.csv file in the current directory, logging system metrics every 5 seconds. Press Ctrl+C to stop monitoring.

Running Forecasting and Suggestions

After collecting sufficient data, run the ML.py script to analyze and forecast system metrics:

python ML.py

This script will:

  • Load and preprocess the monitoring data.
  • Forecast CPU, memory, disk usage, and RAM using time series models.
  • Plot historical data and forecasts with confidence intervals.
  • Generate prioritized system health suggestions based on forecast trends.

Notes

  • Ensure system_monitoring.csv is present in the same directory as the scripts before running ML.py.
  • For small datasets, the forecasting model falls back to exponential smoothing.
  • If pmdarima or transformers libraries are not installed, the scripts will use fallback methods but with reduced functionality.
  • The system monitoring script requires permissions to access system metrics and may need to be run with appropriate privileges.

Dependencies

Key Python libraries used:

  • psutil - for system monitoring
  • GPUtil - for GPU information
  • pandas, numpy - data handling and numerical operations
  • matplotlib - plotting
  • statsmodels, pmdarima - time series forecasting
  • scikit-learn - evaluation metrics
  • TextBlob - sentiment analysis
  • transformers - optional, for advanced NLP suggestions

Refer to requirements.txt for the full list.

License

This project is licensed under the MIT License. See the LICENSE file for details.

This project is provided as-is without warranty. Use at your own risk.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published