点击这里给我发消息

我的ITblog我作主  关注→ 『伊波拉』→ 测试 SzDlinXie- ITblog     

·√· 本ITblog站点记录相关的软件技术文档、网络技术杂志、测试技术杂谈等技术文档的管理站点.联系方式:MSN:dowling@sunlike.cn QQ:94595885

统计

积分与排名

测试技术网站链接

最新评论

Cacti配置e-mail报警

Cacti配置e-mail报警

一、 软件环境:cacti(需Threshold插件)
二、 安装过程:
Cacti的安装各位baidu一下,这里就不详细介绍了。
安装Threshold插件
V0.3.9下载地址:http://mirror.cactiusers.org/downloads/plugins/thold-0.3.9.tar.gzv
安装Threshold插件,只需将解压出来的Thold目录拷贝到cacti/plugins/目录下,并修改cacti配置文件(cacti目录下的include/config.php)。在配置中查找$plugins = array();行,在此行下面加入:
$plugins[] = 'thold';

刷新cacti首页,你将看到多出来一个Threshld选项卡。如下所示

三、 配置过程:
1.设置Threshold插件:选中console选项卡,在左侧菜单中点击Settings,然后点击Alerting/Thold选项卡


2.设置发送警报通知:在Default Alerting Options中选择Send notifications
3.设置出现down机的情况时(即Monitor出现如图所示 )发送警报通知:选择Dead Hosts notifications
报警邮件范例如下:

Host Error : 192.168.1.220 (192.168.1.220) is DOWN
Message : Host did not respond to SNMP           (down机报警)
Host Notice : 192.168.1.207 (192.168.1.207) returned from DOWN state   (恢复)

4.设置警报发送纯文本的电子邮件没有图(默认是HTML电子邮件与图表嵌入在电子邮件):选择Send alerts as text
5.设置周末不执行报警检查:选择Weekend exemptions
6.设置报警的门槛:Default Trigger Count
7.设置Emailing Options

Mail Services:SMTP。(可以选择PHP mail,sendmail,SMTP三种方式)
From Email Address:按实际设置
From Name:按需要设置(该处显示的name就是email的发件人姓名)

8.设置Sendmail Options(Mail Services设置为sendmail需设置此项)

Sendmail Path:/usr/sbin/sendmail(路径是服务器上Sendmail的,仅用于邮件服务选定为Sendmail)

9.设置SMTP Options(Mail Services设置SMTP需设置此项)

SMTP Hostname:SMTP服务器如:mail.test.com
SMTP Port:25
SMTP Username: 通过SMTP发送邮件用来验证的用户名,如果你不要求身份验证留空
SMTP Password:通过SMTP发送邮件用来验证的密码,如果你不要求身份验证留空

测试:点击Send a Test Email,测试成功如下所示:

收到的测试邮件范例:

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 follows
Method: SMTP
Host: mail.ips.com.cn
Port: 25
Authenication: true
Username: john.lv
Password: (Not Shown for Security Reasons)

配置完成后别忘记save。
下面我以磁盘空间报警为例,来设置具体的报警信息(CPU,DISK,服务,网络等等)
在console选项卡下左侧菜单中点击Threshold Templates 。

在如下图所示中点击Add按钮来添加一个Threshold模板

添加磁盘监控的模板,无论是linux还是windows都是使用的Host MIB

设置按照百分比来监控的,在Data Field选择hdd_percent,可以选择hdd_total,hdd_used,hdd_percent三种

设置以下信息(参照下图:)
选择Enabled 激活检查和报警提醒
High Threshold文本框中填入0.085,意思是当硬盘使用率超过85%时,发送邮件报警。
Threshold CDEF下拉框选择Divide by 1024,
Alert E-Mail填入报警的接收邮箱
完成Threshold模板的添加。

应用刚才创建的Threshold模板
在console选项卡下点击Management ->Devices,选择要应用此模板的Host,点击最上面的Create Graphs for this Host链接,然后点击Auto-create thresholds链接来应用刚创建的Threshold模板。

设置完成后在console选项卡下左侧菜单中点击Thresholds

在此可以管理已创建的警报,如下:

点击threshld选项卡可以查看警报的触发情况,如下:

磁盘报警邮件范例:

Host: 192.168.1.207 (192.168.1.207)
URL: http://192.168.1.211/cacti//graph.php?local_graph_id=&rra_id=1
Message: 192.168.1.207 - Used Space - D: Label:tool [hdd_percent] went
above threshold of 0.085 with 0.0896

Ok,磁盘空间的邮件报警就正式配置完成了。

posted on 2008-09-05 23:20 szdlinxie 阅读(1494) 评论(0)  编辑 收藏 引用 所属分类: 电脑技术杂志网络技术杂志操作系统技术杂谈

只有注册用户登录后才能发表评论。
点击这里给我发消息