Linux主从同步监测和利用sendMail来发邮件
首先介绍下sendMail
About SendEmail
SendEmail is a lightweight, command line SMTP email client. If you have the need to send email from a command line, this free program is perfect: simple to use and feature rich. It was designed to be used in bash scripts, batch files, Perl programs and web sites, but is quite adaptable and will likely meet your requirements. SendEmail is written in Perl and is unique in that it requires NO MODULES. It has an intuitive and flexible set of command-line options, making it very easy to learn and use.
[Supported Platforms: Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP]
http://caspian.dotconf.net/menu/Software/SendEmail/
下载解压后就能使用命令行工具了。或者:
安装方法:
1) Extract the package
tar -zxvf sendEmail-v1.XX.tar.gz
2) Copy the sendEmail script to /usr/local/bin
cp -a sendEmail-v1.XX/sendEmail /usr/local/bin
3) Make sure its executable
chmod +x /usr/local/bin/sendEmail
4) Run it
sendEmail
or
/usr/local/bin/sendEmail
部分参数如下:
-f 表示from,发件人地址
-t 表示to,收件人地址
-s mail服务器域名
-u 主题
-xu 用户名(@之前的)
-xp 用户密码
-m 纯文本信息
-o message-file=/root/.. 发送文件中的内容
-a 发送附件 (-m,-o,-a可以同时使用)
例如:
[root@blog sendEmail-v1.56]# ./sendEmail -f aaaa@163.com -t bbbb@163.com -s smtp.163.com -xu aaaa -xp password -u test -m testeamil
Apr 10 10:09:16 blog sendEmail[8861]: Email was sent successfully!
问题:
1·如果出现如下提示
Jan 30 10:06:15 ora01 sendEmail[8704]: ERROR => Connection attempt to localhost:25 failed: IO::Socket::INET: connect: Connection refused
是没有指定-s参数,邮件服务器域名。
shell脚本监测:
http://blog.chinaunix.net/uid-7589639-id-3018209.html
大多数邮件服务都有短信通知服务,比如sina的就有每个月50条免费短信用,对于个人来说,够用了。
最新文章
- bzoj1500
- 一道javascript数组操作题
- AOP学习心得&;jdk动态代理与cglib比较
- python基础知识---操作文件
- dedecms最新版本修改任意管理员漏洞+getshell+exp
- AMD GPU spec (public)
- javascript 金额格式化
- Linux之磁盘管理
- HDU 4288 Coder 【线段树+离线处理+离散化】
- 定时关机命令-shutdown
- JAVA Socket连接服务器时可能抛出的异常
- Java爬虫——B站弹幕爬取
- c#+Unity3D
- Java中的super()使用注意
- vue--vConsole
- receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm
- MyCat不支持的SQL语句
- 7 款顶级的开源 Web 分析软件
- Linux中Kill掉进程的10种方法
- iOS 界面启动时,功能新特征显示