Shell脚本监控Linux系统硬盘各分区使用率
2017-07-04 16:23
351 查看
Shell脚本如下:
#/bin/bash
#environment variable
source /etc/profile
#disk space
for d in `df -P | grep /dev | awk '{print $5}' | sed 's/%//g'`
do
if [ $d -gt 90 ];
then
msg="TIME:$(date +%F_%T)
HOSTNAME:$(hostname)
IPADDR:$(ifconfig |awk 'NR==2{print $2}')
MSG:硬盘使用过高!"
echo $msg
df -h > /test/tt.txt
/test/pymail.py $msg
fi
done
#/bin/bash
#environment variable
source /etc/profile
#disk space
for d in `df -P | grep /dev | awk '{print $5}' | sed 's/%//g'`
do
if [ $d -gt 90 ];
then
msg="TIME:$(date +%F_%T)
HOSTNAME:$(hostname)
IPADDR:$(ifconfig |awk 'NR==2{print $2}')
MSG:硬盘使用过高!"
echo $msg
df -h > /test/tt.txt
/test/pymail.py $msg
fi
done
相关文章推荐
- Linux系统的负载与CPU、内存、硬盘、用户数监控的shell脚本
- linux系统的负载与CPU、内存、硬盘、用户数监控shell脚本
- 利用Shell脚本来监控Linux系统的负载、CPU、内存、硬盘、用户登录数
- Linux监控系统磁盘使用比例,当使用率达到指定比例,删除指定目录下的所有文件的shell脚本
- shell脚本: linux系统的负载与CPU、内存、硬盘、用户数监控
- 利用Shell脚本来监控Linux系统的负载、CPU、内存、硬盘、用户登录数
- Shell脚本监控Linux系统内存使用率
- linux系统的负载与CPU、内存、硬盘、用户数监控shell脚本
- 利用shell脚本来监控linux系统的内存
- Linux常用的系统监控shell脚本
- 使用Shell脚本对Linux系统和进程资源进行监控(转)
- 使用 shell 脚本对 Linux 系统和进程资源进行监控
- 使用 shell 脚本对 Linux 系统和进程资源进行监控
- 使用Shell脚本对Linux系统和进程资源进行监控
- 使用Shell脚本对Linux系统和进程资源进行监控
- 利用shell脚本来监控linux系统的负载与CPU占用情况
- 使用 shell 脚本对 Linux 系统和进程资源进行监控
- 使用 shell 脚本对 Linux 系统和进程资源进行监控
- 使用 shell 脚本对 Linux 系统和进程资源进行监控
- 计算Linux内存,CUP,硬盘使用率的shell脚本