yum install sendmail mailx


abcdefg@qq.com 为发邮件邮箱,123456@qq.com为收邮件邮箱


vi /etc/mail.rc

插入以下内容

set from=abcdefg@qq.com    smtp=smtp.qq.com

set smtp-auth-user=abcdefg@qq.com    smtp-auth-password=123456

set smtp-auth=login


vi /etc/nagios/object/contact.cfg

修改

email   nagios@localhost

email    123456@qq.com


vi host.cfg和service.cfg

将notifications_enabled    改为1