nagios邮件报警设置
1、下载 sendEmailwget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
2、配置 sendEmail
tar zxvf sendEmail-v1.56.tar.gz
cd sendEmail-v1.56
cp sendEmail /usr/local/bin
chmod 777 /usr/local/bin/sendEmail
发送测试邮件
/usr/local/bin/sendEmail -f test@126.com -t test@qq.com -s smtp.126.com -xu test@126.com -xp password -u "nagios" -m "tets"
解释:
-f表示发送者的邮箱
-t表示接收者的邮箱
-s表示SMTP服务器的域名或者ip
-u表示邮件的主题
-xu表示SMTP验证的用户名
-xp表示SMTP验证的密码
-m表示邮件的内容
3、配置contacts.cfg
vi /usr/local/nagios/etc/objects/contacts.cfg输入接收报警邮箱地址
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email test@test.com ;
页:
[1]