博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zabbix告警使用sendEmail
阅读量:6863 次
发布时间:2019-06-26

本文共 3058 字,大约阅读时间需要 10 分钟。

1sendmail介绍

详细介绍见官网:

2使用sendEmail

sendEmail是个十分优秀的发邮件的小工具,比起sendmail强了百倍,我在本地测试zabbix报警的时候,刚开始使用的是sendmail来发送邮件,在测试过程中发现,有时候死活收不到邮件,有时候收到邮件了,但是延迟特别大,要么在垃圾箱里面,很是苦恼.

所以我最后使用了sendEmail工具,感觉特别好用。只要配置正确,邮件就能够及时到达。不说了。直接进入正题

安装:

1  wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz //下载1.56版本2 tar -xzvf sendEmail-v1.56.tar.gz //解压后就可以使用了3 mv sendEmail /usr/local/bin/

一个实例:

1 /usr/local/bin/sendEmail -f [发送者地址] -t "接收者" -s [你的smtp服务器地址] -u "发送的主题" -xu [smtp验证登陆名(邮箱名字)] -xp [你在后台获取的登录密码(一般不是邮箱密码)] -m "邮件内容"2 实例3 /usr/local/bin/sendEmail -f 5712xx@qq.com -t 18387xxx@139.com -s smtp.qq.com -u "我是主题" -o message-charset=utf-8  -xu 5712xx@qq.com -xp airjyrcdzjtbbdbf -m "我是邮 件内容"

简单说下“  -xp [你在后台获取的登录密码(一般不是邮箱密码) ”哪里获取     以qq邮箱为例

第一步:进入qq邮箱,点击设置,然后账户

第二步:点击开启

第三步:

最后:按照提示复制授权码

 

具体详细使用可以看帮助:

1 [root@iZ940ao463eZ alertscripts]# /usr/local/bin/sendEmail help 2 Oct 20 22:40:56 iz940ao463ez sendEmail[29186]: Error: "help" is not a recognized option! 3  4 sendEmail-1.56 by Brandon Zehm 
5 6 Synopsis: sendEmail -f ADDRESS [options] 7 8 Required: 9 -f ADDRESS from (sender) email address10 * At least one recipient required via -t, -cc, or -bcc11 * Message body required via -m, STDIN, or -o message-file=FILE12 13 Common:14 -t ADDRESS [ADDR ...] to email address(es)15 -u SUBJECT message subject16 -m MESSAGE message body17 -s SERVER[:PORT] smtp mail relay, default is localhost:2518 19 Optional:20 -a FILE [FILE ...] file attachment(s)21 -cc ADDRESS [ADDR ...] cc email address(es)22 -bcc ADDRESS [ADDR ...] bcc email address(es)23 -xu USERNAME username for SMTP authentication24 -xp PASSWORD password for SMTP authentication25 26 Paranormal:27 -b BINDADDR[:PORT] local host bind address28 -l LOGFILE log to the specified file29 -v verbosity, use multiple times for greater effect30 -q be quiet (i.e. no STDOUT output)31 -o NAME=VALUE advanced options, for details try: --help misc32 -o message-content-type=
33 -o message-file=FILE -o message-format=raw34 -o message-header=HEADER -o message-charset=CHARSET35 -o reply-to=ADDRESS -o timeout=SECONDS36 -o username=USERNAME -o password=PASSWORD37 -o tls=
-o fqdn=FQDN38 39 40 Help:41 --help the helpful overview you're reading now42 --help addressing explain addressing and related options43 --help message explain message body input and related options44 --help networking explain -s, -b, etc45 --help output explain logging and other output options46 --help misc explain -o options, TLS, SMTP auth, and more

你喜欢的话试试吧,极力推荐,不要再使用sendmail了

转载于:https://www.cnblogs.com/Dicky-Zhang/p/5982973.html

你可能感兴趣的文章