Skip to content

yurenchen000/disk_notify

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 &