Skip to content

yurenchen000/disk_notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f7cb5fe · Nov 30, 2024

History

39 Commits
Nov 30, 2024
Oct 26, 2024
Oct 26, 2024
Oct 22, 2024
Oct 25, 2024
Oct 25, 2024
Oct 22, 2024
Oct 22, 2024
Oct 25, 2024
Oct 26, 2024
Oct 25, 2024
Oct 26, 2024

Repository files navigation

disk notify

send notify if disk avail space low

README 中文

only-bash.jpg

  • Lightweight: only bash, df, curl
  • Focus: only notify alert if space low
  • Accuracy: partition specified threshold
  • Reliable: multiple push channels

🛠️ Settings

it can monit multi mountpoint with specified thresholds
by bash associative array. (key-value pairs)

declare -A mount_thresholds=(
    ["/"]="5120"      # 5 GB in MB
    ["/tmp"]="1024"   # 1 GB in MB
)

supported notify backends

  • telegram bot
  • feishu bot
  • wework bot
  • dingtalk bot
  • pushplus
  • wxpusher
  • serverchan

logs

  • disk_log=disk_hist.log //disk space log
  • send_log=send_hist.log //send noitfy log

notify frequency

  • push_delay=30 //push interval (will adjusted dynamically)

check frequency

  • save_interval=3600 // 1 hour
  • check_interval=300 // 5 min

🚀 Usage

download from https://github.com/yurenchen000/disk_notify/releases/latest
and uncompress it.

// edit conf base on example

cp -pv _disk_notify_global.example _disk_notify_global  
// modify the conf according to your needs  

conf file

  • ./_disk_notify_global
  • ~/.config/_disk_notify

// run in background

nohup ./disk_notify.sh &> disk_notify.out &