Cacti 0.8.8b 插件(monitor thold setting realtime)安装及邮件 短信告警

类别:原创 服务器javascript

本文参考php

《使用cacti + snmp 实现对apache 、mysql 、 nginx 的监控的安装和配置 》http://jedy82.blog.51cto.com/425872/888803java

 

第一:说明mysql

目的:本机前提是已安装好了cacti 0.8.8b 并正常工做,本文档主要配置cacti插件并启用邮件短信告警nginx

其它说明: cacti 0.8.8b的安装请参考个人另外一篇博客文章《Cacti 0.8.8b 安装配置(含snmp配置) http://jedy82.blog.51cto.com/425872/1569689sql

本文在此基础上配置apache

Cacti服务器ip:192.168.10.112,cacti 使用yum方式安装,默认路径为/usr/share/cacti服务器

第二:本例操做环境     ide

[root@i-tcz0hdhc ~]# yum update -y测试

[root@i-tcz0hdhc ~]# uname -a

Linux i-tcz0hdhc 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@i-tcz0hdhc ~]# more /etc/redhat-release 

CentOS release 6.6 (Final)

[root@i-tcz0hdhc ~]# 

第三:插件安装

插件下载地址:

http://docs.cacti.net/plugins

一、 安装插件 

[root@i-tcz0hdhc ~]# wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz

[root@i-tcz0hdhc ~]# wget http://docs.cacti.net/_media/plugin:realtime-v0.5-2.tgz

[root@i-tcz0hdhc ~]# wget http://docs.cacti.net/_media/plugin:thold-v0.5.0.tgz

[root@i-tcz0hdhc ~]# wget http://docs.cacti.net/_media/plugin:monitor-v1.3-1.tgz

[root@i-tcz0hdhc ~]# cd /usr/share/cacti/plugins

[root@i-tcz0hdhc plugins]# 

[root@i-tcz0hdhc plugins]# tar -zxvf /root/plugin\:settings-v0.71-1.tgz

[root@i-tcz0hdhc plugins]# tar -zxvf /root/plugin\:realtime-v0.5-2.tgz

[root@i-tcz0hdhc plugins]# tar -zxvf /root/plugin\:thold-v0.5.0.tgz 

[root@i-tcz0hdhc plugins]# tar -zxvf /root/plugin\:monitor-v1.3-1.tgz 

  

二、 启用插件管理功能 

Console → Utilities → User Management → admin → Realm Permission 勾选 Plugin Management 后保存 

* 一般这一步不用作,默认就是在的。

wpsD68C.tmp


三、 激活安装插件


 Console → Configuration → Plugin Management → Action 


wpsD6AC.tmp


安装插件(逐个点击向下小箭头)

wpsD6AD.tmp


启用插件(再点击向右的绿箭头)


wpsD6BD.tmp

此时 cacti插件安装成功



wpsD6BE.tmp

第三:插件配置和使用


一、 使用monitor插件


a.打开“Console → Settings → Misc”,能够调整Monitor的各项配置。


例如:勾选“Show Icon Legend”能够在监控页面显示图例,“View”能够选用Tiles类型,以显示设备状态表格。


b. 为cacti添加新设备时,勾选上“Monitor Host”项。对已添加的设备能够经过“Management → Devices”进去修改。


c.单击Web页面上方的“monitor”标签连接,能够进入查看各设备/主机的状态图示。



二、使用realtime插件

安装完realtime,在每个监控图边上,都会有一个小图标,此时点击这个小图标,不会出来实时的数据,会报The Image Cache Directory directory does not exist. Please first create it and set permissions and then attempt to open another realtime graph”

提示出没有Cache目录以及权限等的错误,须要进一步配置后才能取到数据

wpsD6CF.tmp


a. 设置Cache目录及权限

在cacti服务器上作以下操做:


[root@i-tcz0hdhc cacti]# cd /usr/share/cacti/


[root@i-tcz0hdhc cacti]# mkdir cache


[root@i-tcz0hdhc cacti]# chown apache.root cache


 

b. 登录cacti网页


打开“Console → Settings → Misc”,设置“Cache Diredtiory”“/usr/share/cacti/cache/”,保存后会出现 [OK: DIR FOUND]


wpsD6E0.tmp

此时再点击上图的小图标就会出来数据了

wpsD6E1.tmp


三、 使用thold插件


使用thold以前 先要配置email参数


a. 配置email参数


wpsD6F1.tmp


打开“Console → Settings → Mail/DNS”能够调整“SMTP wpsD702.tmpOptions”“DNS Options”等配置。

Test Email: 你的收件箱地址

Mail Services:SMTP 你的邮箱类型

From Email Address:发件邮箱地址

From Name:发件人描述

SMTP Hostname:发件邮件的smtp服务器

SMTP Username:你的发件邮箱的用户名

SMTP Password:你的发件邮箱密码

DNS Options : 下配置你的DNS主从服务器,如8.8.8.8

填写完成后,点击“Save”。而后再占击右上角的Send a Test Email”测试邮件功能


b. 开启短信提醒


在189邮箱(或是其它支持短信提醒功能的邮箱)里开启短信提醒功能,这样收到新邮件后,手机就能收到短信提醒了。


邮箱中的短信提醒功能设置这里再也不说明。



c. 设置thold模板


打开“Console → Settings → Thresholds”,能够调整Thold的各项配置。例如:“Dead Host Notifications Email”处可填写设备当机时发送警告信息到哪一个邮箱;勾选“Send alerts as text”项,能够设置只发送文本格式的邮件。


这里要注意的是,有部分邮箱的短信提醒功能只支持纯文本格式的邮件。


wpsD712.tmp

wpsD723.tmp


d. 建立通知列表(可省略)

打开Console -> Notification Lists,可添加一个邮件列表

wpsD724.tmp


e. 建立告警模板

打开Console -> Threshold Templates”,能够添加、取出须要关联到预警系统的模板,例如:能够添加和“Interface-Traffic”

wpsD735.tmp

按照提示一步步的进行。


选择“traffic_in”数据项,分别设置警告阈值“High Warning Threshold ”(如200000000比特/秒)和“Low Warning Threshold ”“Data Manipulation” 能够选择数值的类型。


Other setting中能够附加告警时通知的邮件联系人。Warning Notification List ”和Alert Notification List 只有建立过通知列表后这两项才会显示


wpsD736.tmp


f. 告警的项

打开“  Create → New Graphs ”,选择须要提供预警的设备,单击右侧上方的“ Auto-create thresholds”自动建立预警项目。      
打开“Management → Thresholds”,能够管理已经建立的预警项目。 

或者在“Management → Thresholds”中手动建立告警项

 

如只安装thold,查看[thold]中,会出现:You are missing a dependency for thold, please install the 'Settings' plugin. 将“settings"插件install-Enable后就能够了。

 

Setting不须要单独配置,但setting又是必须的 

 

monitor thold setting realtime插件安装完毕

相关文章
相关标签/搜索