Skip to content

CtrlAltJon/UnifiDreamMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DMSE_status.sh

Bash script to collect system status information from a UniFi Dream Machine and send a formatted status message to a Telegram channel using a bot.
Tested on Dream Machine Special Edition.

Features

  • Collects system, CPU, memory, disk, and hardware information
  • Formats the status message for Telegram using MarkdownV2
  • Sends notifications to a specified Telegram chat/channel
  • Supports silent notifications

Usage

  1. Configure the script:

    • Set your Telegram bot token and chat ID in the variables section:
      BOT_TOKEN="your_bot_token"
      CHAT_ID="your_chat_id"
    • Update the IPfile variable to point to your public IP saved in a file, if you have it.
  2. Make the script executable:

    chmod +x DMSE_status.sh
  3. Run the script:

    ./DMSE_status.sh

Requirements

  • Bash shell
  • Utilities: awk, grep, df, free, sensors, hddtemp, ubnt-device-info, ubnt-systool, curl
  • A Telegram bot and chat/channel

Example Output

The script sends a message like this to your Telegram channel:

*DMSE - System Status* ℹ️
up 1 weeks, 1 day, 1 hour, 45 minutes

💻 HARDWARE
MB Temp................... 45°C
CPU Temp.................. 60°C
FAN Speed............. 1200 RPM

📄 SOFTWARE
Firmware................ 1.10.0
MAC.......... AA:BB:CC:DD:EE:FF
IP..................... 1.2.3.4
RAM................. 512M/1024M
CPU Load.................... 5%
Load Avg1................. 0.10
Load Avg5................. 0.15
Load Avg15................ 0.20

🌀 STORAGE - /dev/sda
Brand.................. Samsung
Model................... SSD850
Temperature............... 35°C
OS Partition....... 2G/8G - 25%
Data Partition..... 1G/4G - 20%

Notes

  • Ensure all required utilities are installed and accessible in your environment.
  • The script is designed for UniFi Dream Machine but can be adapted for other systems.
  • For MarkdownV2 formatting, only escape the necessary characters as per Telegram documentation.

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open an issue or submit a pull request.

License

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

Author

CtrlAltJon

Releases

No releases published

Packages

No packages published

Languages