@cacti
1.install epel extends source
2.install lamp use yum method
yum install -y httpd php php-mysql mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel
3.install cacti net-snmp rrdtool
yum install -t cacti net-snmp net-snmp-utils rrdtool
4.start the service
/etc/init.d/mysqld httpd snmpd start
5.edit httpd conf files
vim /etc/httpd/conf.d/cacti.conf
change “Deny from all ” to "Allow from all"
/etc/init.d/httpd restart
6.import data create cacti database
mysql uroot -e "create database cacti"
create cacti user:
mysql -uroot -e "grant all on cacti.* to ‘cacti‘@127.0.0.1‘ identified by ‘passw0rd‘;"
import sql file
mysql -uroot cacti</usr/share/doc/cacti-0.8b/cacti.sql
7.edit cacti conf file
vim /usr/share/cacti/include/config.php
$database_type="mysql";
$fatabase_default="cacti";
$database_hostname="127.0.0.1";
$database_username="cacti";
$database_password="passw0rd";
$database_port="3306";
$database_ssl=false;
8.access cacti and install
http://ip/cacti
点两下“next” 和一次”Finish“ 即可
输入admin admin 登录,重新设置新的密码
9.execute poller.php .generate the grap , add corn
/usr/bin/php /usr/share/cacti/poller.php
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php
... install client
1. 安装snmp
yum install -y net-snmp
2. 修改snmpd.conf
修改syslocation以及syscontact, 其中syslocation 可以写本机ip,syscontact写管理员邮箱
syslocation 11.20
syscontact Root [email protected]
3. 启动snmp
service snmpd start
4. 登录cacti管理后台,点console , 再点Device, 在右上角点”Add“
Description 写本机ip或你自定义一个名字
Hostname 写本机ip
Host Template 选ucd/net SNMP Host
SNMP Version 选Version 2
点右下角的create
点右上角的”Create Graphs for this Host“
Graph Types: 选择SNMP - Interface Statistics
在下面框中选择要监控的网卡,比如我选择eth0, 在最右侧小方块里打对勾,然后点右下角的create
Graph Types: 再选择 Graph Template Based
在下面的框中,选择你要监控的项目,比如ucd/net - Load Average
在右侧小方块中打对勾,然后点右下角的create
5. 点左侧的Graph Trees
选中”Default Tree“
点右上角的Add
Tree Item Type 选择 ”Host“
Host 选择我们刚刚增加的那个机器ip
点右下角的create
6. 点左上角的Graphs
在左侧可以看到
Defaut Tree下面已经增加了我们刚刚添加的主机,图形一开始不会那么快出来,要等一小会才可以
@nagios