- 论坛徽章:
- 0
|
分享一个监控http的脚本如果利用sendEmail发送报警邮件:- cd /opt
- wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
- tar -zxvf sendEmail-v1.56.tar.gz
- cd sendEmail-v1.56
- cp sendEmail /usr/local/bin
- chmod +x /usr/local/bin/sendEmail
复制代码 #sendEmail使用方法- sendEmail -f 13512345678@139.com -t 13512345678@139.com -s smtp.139.com -u "from cacti" -xu 13512345678@139.com -xp 123456 -o message-charset=utf-8 -m “测试邮件发送”
复制代码 把原脚本中的- curl -m 600 -d username=${telnum} -d password=${passwd} -d sendto=13500000000 -d message=$1 http://sms.api.bz/fetion.php
复制代码 修改为:- sendEmail -f 13512345678@139.com -t 13512345678@139.com -s smtp.139.com -u "from cacti" -xu 13512345678@139.com -xp 123456 -o message-charset=utf-8 -m $1
复制代码 |
|