Nagios设置smtp方式告警
-
关闭本机的sendmail服务或者postfix服务
#sendmial service sendmail stop chkconfig sendmail off #postfix service postfix stop chkconfig postfix off #再狠一点就直接卸载吧.. yum remove sendmail yum remove postfix
-
检查mailx版本
rpm -qa|grep mailx mailx-12.4-6.el6.x86_64 mailx -V 12.4 7/29/08
-
配置mailx:/etc/mail.rc,添加如下行:
set from=youemail@163.com set smtp=smtp.163.com set smtp-auth-user=mymon set smtp-auth-password=111111 set smtp-auth=login
-
测试发送邮件
echo "hello word" | mail -v -s " mailx test" youemail@163.com