首页 > 其他 > 详细

centos7.2:CPU邮箱报警

时间:2018-04-17 14:16:22      阅读:332      评论:0      收藏:0      [点我收藏+]
CPU报警,系统为centos7.2,用于其他系统需要改位置变量。

#!/bin/bash

if [ -e /detection_script ]
then
mkdir -p /detection_script/
else
mkdir -p /detection_script/
fi
IP=ip a | grep inet | grep -v inet6 | grep -v 127 | sed ‘s/^[ \t]*//g‘ | cut -d ‘ ‘ -f2
AA=/usr/bin/uptime | awk -F‘[\t. ]‘ ‘{print $(NF-1)}‘
if [ $AA -ge 5 ]
then
echo "dev:当前$IP地址cpu已达到理论峰值 5%
15分钟值为: $AA" | mail -s "$Ip":CPU异常 amunlinux@163.com

fi

/bin/mv cpuload_new.sh /detection_script/

centos7.2:CPU邮箱报警

原文:http://blog.51cto.com/amunlinux/2104356

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!