执行远程主机上面的shell

[root@web shell]# cat checkdisk.sh
#!/bin/bash
result=`ssh root@10.10.10.20 -p22 "/bin/bash /app/shell/checkdisk.sh"`
result=${result/\%/}
if [ "$result" -gt "90" ];then
echo "磁盘空间不足";
/usr/bin/python /app/shell/mail.py "磁盘监控报警" "10.10.10.20 数据盘 ${result}%>=90%"

fi

ssh root@10.10.10.20

[root@web_win shell]# cat checkdisk.sh
#!/bin/bash
df -h | grep /dev/vdd | awk '{print $5}'

    A+
发布日期:2017年06月04日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: