标签:cacti
所需软件包:cacti-0.8.8h.tar.gz cacti-spine-0.8.8h.tar.gz php-snmp-5.3.3-26.el6.x86_64.rpm
yum install httpd
tar zxf cacti-0.8.8h.tar.gz -C /var/www/html/
cd /var/www/html/
ln -s cacti-0.8.8h/ cacti
yum install -y php php-mysql mysql-server php-server php-snmp net-snmp rrdtool php-gd php-dom net-snmp-utils
yum install php-snmp-5.3.3-26.el6.x86_64.rpm -y
vim /etc/php.ini
将946行注释取消,将date.timezone的值改为Asia/Shanghai
php -m
sockets session mysql mysqli snmp
/etc/init.d/mysqld start
mysql登入
create database cacti;
grant all on cacti.* to cacti@localhost identified by ‘westos‘;
mysql -ucacti -pwestos cacti 可以成功登录
mysql_secure_installation
cd /var/www/html/cacti
mysql -ucacti -pwestos cacti < cacti.sql
mysql -ucacti -pwestos cacti
show tables;
cd include/
vim config.php
29行database_username改为cacti
30行database_password改为westos(cacti用户密码)
39行和42行注释去掉
cd ..
ll
useradd -u 1000 cacti##将所有人和所有组都改为cacti
su - cacti
crontab -e
内容:*/5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
logout
/etc/init.d/httpd restart
http://172.25.45.1/cacti/install/
Next Finsh
用户名:admin 密码:admin
设置新密码
首页
【server2】
yum install -y net-snmp net-snmp-utils
/etc/init.d/snmpd start
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
vim /etc/snmp/snmpd.conf
/etc/init.d/snmpd restart
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.172.25.45.2 = INTEGER: 2
【server1】
snmpwalk -v 1 -c public 172.25.45.2 IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.172.25.45.2 = INTEGER: 2
【server2】
/etc/init.d/snmpd reload
【server1】
/etc/snmp/snmpd.conf
snmpwalk -v 1 172.25.45.2 -c public .1.3.6.1.4.1.2021.9
snmpwalk -v 1 172.25.45.2 -c public .1
【server2】
scp /etc/snmp/snmpd.conf root@172.25.45.1:/etc/snmp/
【server1】
/etc/init.d/snmpd start
snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.172.25.45.1 = INTEGER: 2
http://172.25.45.1/cacti
Devices-Add-Create Graphs for this Host
Graph Trees-Default Tree-Add
【server1】
cd /var/www/html/cacti/rra
rrdtool info server2_mem_free_16.rrd | less
插件
cacti-spine-0.8.8h.tar.gz
【server1】
tar zxf cacti-spine-0.8.8h.tar.gz
yum install -y mysql-devel net-snmp-devel
yum install -y openssl-devel
yum install dos2unix autoconf automake binutils libtool gcc cpp glibc-headers kernel-headers glibc-devel
cd cacti-spine-0.8.8h
sh bootstrap
./configure
make
make install
cd /usr/local/spine/etc/
cp spine.conf.dist /etc/spine.conf
vim /etc/spine.conf
修改DB_User为cacti,密码为设置的密码
su - cacti
/usr/local/spine/bin/spine
SPINE: Using spine config file [/etc/spine.conf]
SPINE: Version 0.8.8h starting
SPINE: Time: 0.1084 s, Threads: 5, Hosts: 3
http://172.25.45.1/cacti
Settings-Poller
cd /var/www/html/cacti/log
cat cacti.log
软件包:monitor-v1.3-1.tgz
tar zxf monitor-v1.3-1.tgz -C /var/www/html/cacti/plugins
http://172.25.45.1/cacti
Plugin Management
Settings-Misc
标签:cacti
原文地址:http://wjl19940429.blog.51cto.com/11354210/1792394