https://github.com/leafney/disk-monitor-dingtalk
disk monitor 监控磁盘空间使用率并发送钉钉提醒
https://github.com/leafney/disk-monitor-dingtalk
dingtalk shell
Last synced: about 2 months ago
JSON representation
disk monitor 监控磁盘空间使用率并发送钉钉提醒
- Host: GitHub
- URL: https://github.com/leafney/disk-monitor-dingtalk
- Owner: leafney
- Created: 2019-06-18T09:45:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-18T14:00:52.000Z (almost 6 years ago)
- Last Synced: 2025-04-11T21:06:25.289Z (about 2 months ago)
- Topics: dingtalk, shell
- Language: Shell
- Homepage:
- Size: 80.1 KB
- Stars: 6
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### disk-monitor
#### parameters
* `-t` -- `dingtalk_token`: **`Required`** dingtalk token
* `-p` -- `max_percent`: threshold percent,default `80`,between `0` to `100`
* `-h` -- `custom_host`: default get `hostname` or custom by yourself
* `-n` -- `send_when_normal`: Whether to send notify when disk space is normal,default `false`#### how to use
```
$ chmod +x ./disk-monitor.sh
$ ./disk-monitor.sh -t$ ./disk-monitor.sh -t -n
```**Note**
The Ubuntu system may encounter errors `awk: line 2: function strtonum never defined`,Please install:
```
$ sudo apt-get install gawk
```#### use with crontab
```
$ crontab -l
* * * * * /home/tiger/disk-monitor.sh -t > /dev/null 2>&1 &
```#### demo

Article: [监控磁盘空间使用率并发送钉钉提醒 | IT范儿](https://www.itfanr.cc/2019/06/18/disk-monitor-send-dingtalk/)