环境:centos6.2,cacti 0.8.8.a,net-snmp5.5
1、今天弄cacti邮件报警,刚开始启动sendmail不成功,一直提示:
”sendmail dead but subsys locked sm-client (pid 13588) is running...“,
之后查看其/var/log/maillog提示“postfix/smtpd[10859]: disconnect from localhost[127.0.0.1]”
及25端口,
netstat -tlnp |grep :25 tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 11180/master tcp 0 0 ::1:25 :::* LISTEN 11180/master 之后停止postfix或sendmail,使用其中之一,好像是centos6.2自动安装并启动了postfix服务器,
2、配置
安装thold-v0.4.9-3.tgz、plugin-monitor-v1.3-1.tgz插件,解压放到cacti/plugins 目录下,到控制台启用插件,
console-->seting--->Mail/DNS--
Mail Services 我用的是SMTP ,根据自己的选择,但是大部分情况用sendmail会出错+
From Email Address huazi_91@139.com From Name problem alertSMTP Options中都要写真实的自己的邮局,不然smtp的发信机制会发布出去
SMTP Hostname 写自己的,我的是huazi_91@139.com
SMTP Port 25 SMTP Username huazi_91@139.com SMTP Password xxxxConsole -> Cacti Settings- 选项
下面这些都是主意修改的地方Base URL 这个会自动发现不用写
Syslogging 这个勾要选择,不然他不会给你发邮件 Dead Hosts Notifications 这个要选择 Dead Host Notification Email 这个是主机down掉会发邮件通知谁(这里写要通知的邮局,多人可以用逗号隔开)。From Email Address 写邮件的发送方
From Name 写problem alert
1.发送邮件报警错误
Checking Configuration...Creating Message Text...This is a test message generated from Cacti. This message was sent to test the configuration of your Mail Settings.Your email settings are currently set as followsMethod: SendmailSendmail Path: /usr/sbin/sendmailSending Message...ERROR: DirectInject command output: 'Recipient names must be specified ' error: ''DirectInject command output: 'Recipient names must be specified ' error: ''===================那么setting---mail/DNS选项或者alert选项中,把sendmail发信机制改成smtp2.如果出现553.3.8.2 认证错误,那么请填写正确smtp信息比如用户名密码
之后,就是设置阀值报警,
配置参考地址: