nagios配置139邮箱报警,收不到邮件
nagios吧
全部回复
仅看楼主
level 1
Demon凌祖 楼主
vi commands.cfg配置如下
define command{ command_name notify-host-by-sendEmail command_line /usr/bin/printf "%b" "***** Nagios-BJ *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -f ******@163.com -t $CONTACTEMAIL$ -s smtp.163.com -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -xu ****** -xp ********* -l /var/log/sendEmail.log
}
define command{ command_name notify-service-by-sendEmail command_line /usr/bin/printf "%b" "***** Nagios-BJ *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/local/bin/sendEmail -f ******@163.com -t $CONTACTEMAIL$ -s smtp.163.com -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" -xu ****** -xp ****** -l /var/log/sendEmail.log
}
2012年12月21日 02点12分 1
level 1
Demon凌祖 楼主
vi contacts.cfg 配置如下
define contact{
contact_name nagiosadmin
alias system admin
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r
service_notification_options w,u,c,r
service_notification_commands notify-service-by-sendEmail
host_notification_commands notify-host-by-sendEmail
email ***********@139.com
pager ***********
}
2012年12月21日 02点12分 2
level 1
Demon凌祖 楼主
配置如上,但是测试不能收到邮件,求大神指教
2012年12月21日 02点12分 3
level 1
用 /bin/mail
2013年08月07日 10点08分 5
level 7
和 v 和司法部长女看看 vu 飞 v 信用卡被曝光嘉年华
2014年01月16日 03点01分 6
level 1
nagios服务器可以联网不?手动测试下 usr/local/bin/sendEmail –f 发送者的邮箱 –t 接收者的邮箱 –s SMTP服务器的域名或者ip –u “邮件的主题” –xu SMTP验证的用户名 –xp SMTP验证的密码 –m 邮件的内容。 /usr/local/bin/sendEmail 权限属主呢?有没有配置。不光要配置commands.cfg,还要配置misccommands.cfg。
2014年03月14日 03点03分 7
level 5
vim /etc/mail.rc
2015年03月13日 08点03分 8
1