Skip to content

v1.0.0

Choose a tag to compare

@Hsnmsri Hsnmsri released this 09 Sep 19:28
· 56 commits to main since this release

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/stat file.
  • Memory Monitoring Feature: The program can now monitor memory usage using the /proc/meminfo file.
  • Telegram Bot Integration: Full integration with the TgBot library to send CPU and memory status messages to a specified Telegram chat.
    • /usage command: Sends a detailed report of the CPU and memory status to the user.
    • /help command: 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.json file 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/stat and /proc/meminfo files on certain systems.
  • Corrected the improper CPU percentage display in Telegram output.
  • Enhanced readability and formatting of logs by using std::put_time to format dates and times more effectively.

Known Issues

  • If the settings.json file 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:

  1. The settings.json file 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