Repository navigation
v1.0.0
Changelog
All notable changes to this project will be documented in this file.
[1.0.0] - 2024-09-09
Added
- CPU Monitoring Feature: Added the ability to monitor CPU usage using the
/proc/statfile. - Memory Monitoring Feature: The program can now monitor memory usage using the
/proc/meminfofile. - Telegram Bot Integration: Full integration with the
TgBotlibrary to send CPU and memory status messages to a specified Telegram chat./usagecommand: Sends a detailed report of the CPU and memory status to the user./helpcommand: Displays a list of available bot commands in Telegram.
- Telegram Notifications: Sends alerts to Telegram when CPU or memory usage exceeds defined thresholds.
- JSON Configuration Support: Added the ability to read and use a
settings.jsonfile for configuring key values like bot token, chat ID, CPU, and memory limits. - Logging System: Implemented a logging system to log important activities and events using the
log()function. - Multithreading: Utilized multiple threads to run CPU monitoring, memory monitoring, and Telegram bot simultaneously for improved performance.
Changed
- Updated the
log()function to log precise timestamps along with event messages. - Improved Telegram bot stability by implementing restart mechanisms in case of errors.
- Adjusted default CPU and memory check intervals to 500 milliseconds for more frequent monitoring.
Fixed
- Fixed the issue with accessing
/proc/statand/proc/meminfofiles on certain systems. - Corrected the improper CPU percentage display in Telegram output.
- Enhanced readability and formatting of logs by using
std::put_timeto format dates and times more effectively.
Known Issues
- If the
settings.jsonfile is missing, the program exits without displaying an appropriate error message. - The program may not work properly on systems that lack
/proc(such as certain virtualized environments).
Usage Instructions:
- The
settings.jsonfile should contain the following configuration:{ "bot_token": "YOUR_BOT_TOKEN", "chat_id": "YOUR_CHAT_ID", "cpu_check_duration": 500, "memory_check_duration": 500, "cpu_limit": 80, "memory_limit": 80 }
Full Changelog: https://github.com/Hsnmsri/linux_monitoring/commits/v1.0.0