转载自:http://blog.csdn.net/hubi0952/article/details/46813851
df -TPh|awk '+$6>80 {print $1}'
然后再配置报警
注意$6前的+号,使用算术运算符进行操作时,操作数自动转换为数值,如下,一看便知:
[root@cnc ~]# df -TPhFilesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext3 4.0G 790M 3.0G 21% / tmpfs tmpfs 12G 0 12G 0% /dev/shm /dev/sda7 ext4 878G 1.2G 832G 1% /data0 /dev/sdb1 ext4 459G 117G 319G 27% /data1 /dev/sdb2 ext4 459G 196G 240G 45% /data2 /dev/sdc1 ext4 917G 205G 666G 24% /data3 /dev/sdd1 ext4 917G 203G 669G 24% /data4 /dev/sdf1 ext4 917G 203G 668G 24% /data5 /dev/sdg1 ext4 917G 202G 670G 24% /data6 /dev/sdh1 ext4 917G 623G 248G 72% /data7 /dev/sda5 ext3 7.9G 203M 7.3G 3% /tmp /dev/sda1 ext3 12G 6.9G 4.4G 62% /usr /dev/sda6 ext3 7.9G 1.1G 6.5G 15% /var[root@cnc ~]# df -TPh|awk '{print $6}'Use%21%0%1%27%45%24%24%24%24%72%3%62%15% [root@cnc ~]# df -TPh|awk '{print +$6}'021012745242424247236215