任务:
Cacti系统性能监控
Cacti补丁升级
Cacti thold插件管理
Cacti邮件报警
Cacti软件安装
Lamp环境
Linux+apache+mysql+php
安装rrdtool的依赖包
Yum–y install pango pango-devel freetype freetype-devel libpng libpng-develgettext gettext-devel libjpeg libjpeg-devel gb gb-devel libxml2 libxml2-devellibiconv libiconv-devel qpixman qpixman-devel glib glib-devel cairo cairo-devellibart*
安装rrdtool绘图软件
Tar–xzvf rrdtool-1.4.5.tar.gz
Cdrrdtool-1.4.5
./configurate–prefix=/usr/local/rrdtool
Make && make install
安装snmp
Yum-y install net-snmp*
修改配置文件snmpd.conf
rocommunitypublic
disk/ 100000
disk/boot 10000000
启动服务
Service snmpd restart
Netstat –tunpl | grep 161
Netstat –tunpl | grep 162
Chkconfig --list | grep snmp
Chkconfig --level 35 snmpd on
Cacti源码安装
Tarxzf cacti-0.8.7h-beta3.tar.gz
Rsync–a cacti-0.8.7h-beta3.tar.gz/ /usr/local/apache/htdos/cacti/
Vi/usr/local/apache2/etc/httpd.conf
Userapache
Groupapache
Setfacl–m u:apache:rwx –R htdocs/
Setfacl –m d:u:apache:rwx –R htdocs/
Getfaclhtdocs/
Mysql –uroot –p
Createdatabase cactidb default character set utf8
Grantall on cactidb.* to cactiuser@localhost identify by ‘123’
Quit
Cdcacti
Mysql–ucactiuser –p123 cactidb <cacti.sql
Vi/usr/local/apache/htdocs/cacti/include/config.php
$database_default= “cactidb”
$database_username= “cactiuser”
$database_password= “123”
$database_ssl= “false”
$url_path= “/cacti/”
计划任务
Crontab–e
*/5* * * * /usr/local/php/bin/php /usr/local/apache2/htdocs/cacti/poller.php&>/dev/null
测试
192.168.100.1/cacti
指定php位置
账号密码adminadmin
安装配置apache图形模板
安装配置apache状态监控server-status
在etc/extra/下Grep –i“server-status” *
Apache的状态管理模块
LoadModulestatus_module modules/mod_status.so
对apache servrstatus 启用
ExtendedStatuson
配置apacheserver status
<location/server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from all
</location>
查看apache的加载模块
bin/apachectl–t –D DUMP_MODULES
重启apache测试
bin/apachectl restart
192.168.100.1/server-status
Cacti插件安装
安装cacti patch包
Cpcacti-plugin-0.8.7h-PA-v3.0.diff /usr/local/apache/htdocs/cacti/
Cp pa.sql/usr/local/apache/htdocs/cacti/
Patch –p1 –N < cacti-plugin-0.8.7h-PA-v3.0.diff
Mysql –ucactiuser –p123 cactidb < pa.sql
Vi/usr/local/apache/htdocs/cacti/include/global.php
插件安装权限分配admin
Console->usermanagement->admin->Plugin Management
Console->Configuration->PluginManagement
解压settings-v0.71-1.tgzmonitor(效果不是很好)和thold-v0.4.9-3.tgz软件包,copy到/usr/local/apache/htdocs/cacti/plugins/
Chown–R cactiuser:cactiuser cacti/
或setfacl –m u:apache:rwx–R htdocs
setfacl –m d:u:apache:rwx –R htdocs
此时可以在pluginmanagement中看到三个蓝色插件
安装settings和thold
Vim/usr/local/apache/htdocs/cacti/include/config.php
$plugins=array()
$plugins[]=”settings”
$plugins[]=”thold”