forked from nullscc/skynet_with_note
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsys.sh
executable file
·28 lines (22 loc) · 805 Bytes
/
sys.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
function check_disk()
{
disk=`df -h | grep /home | awk '{print $5}' | cut -f 1 -d "%"`
if [ $disk -gt 90 ]; then
nohup curl "http://apis.haoservice.com/sms/send?mobile=18676670538&tpl_id=1773&tpl_value=&key=0a84fdc47c734dd290a7bb06460a1df9" &
fi
}
function check_mem()
{
mem=`free | grep Mem | awk '{print $4}'`
if [ $mem -lt 200000 ]; then
nohup curl "http://apis.haoservice.com/sms/send?mobile=18676670538&tpl_id=1773&tpl_value=&key=0a84fdc47c734dd290a7bb06460a1df9" &
fi
}
function check_cpu()
{
cpu=`vmstat 2 3 | awk 'BEGIN{n=0} {if(NR>0){n=n+$15}} END{print n}'`
if [ $cpu -lt 20 ];
nohup curl "http://apis.haoservice.com/sms/send?mobile=18676670538&tpl_id=1773&tpl_value=&key=0a84fdc47c734dd290a7bb06460a1df9" &
fi
}