- This project objective is to develop a Python Script that monitors local system resources (CPU usage, memory usage and disk usage) and logs the info to a file every hour. It aims to provide real-time insights into system performance and resource utilization.
- It automates the exection of the script using 'cron' on Unix-based system.
- Decided to impelement dockerization for simplified deployment.
- Have Python 3.9 or higher installed
- Have Docker installed
- Clone this repo to your local machine
git clone https://github.com/your-username/your-repo.git
- Run python script:
python system_monitor.py
-
Verify logs, check the 'system_monitor.log' file. It should contain logged data about CPU, memory and disk usage every hour.
-
Automate Script Execution
- Using 'cron expression' on Unix-based systems.
- Build Docker image:
docker build -t system-monitor .
- Run the Docker container:
docker run -d --name system-monitor system-monitor
- Grafana Integration to leverage on features such as visualizing system resource metrics.
- Configure Prometheus to scrape metrics from the Python application.
Enjoy!