(十)企业部分之cacti
所需软件包:cacti-0.8.8h.tar.gz cacti-spine-0.8.8h.tar.gz php-snmp-5.3.3-26.el6.x86_64.rpmyum install httpdtar zxf cacti-0.8.8h.tar.gz -C /var/www/html/cd /var/www/html/
ln -s cacti-0.8.8h/ cactiyum 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;
http://s4.运维网.com/wyfs02/M00/83/2A/wKiom1dsBl-gwJYHAACD4D-UmMs675.png
cd include/
vim config.php 29行database_username改为cacti
30行database_password改为westos(cacti用户密码)
39行和42行注释去掉
http://s1.运维网.com/wyfs02/M01/83/29/wKioL1dsBnfR6kMuAADb4XETajA380.png
cd ..
llhttp://s2.运维网.com/wyfs02/M01/83/2A/wKiom1dsBoqC8RrAAADHDM4Guf8729.png
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/
http://s5.运维网.com/wyfs02/M02/83/29/wKioL1dsBpfAzrIfAADV67rOVEY290.png
Next Finsh
http://s5.运维网.com/wyfs02/M01/83/29/wKioL1dsBqehR-9xAACtCE5sVlA403.png
用户名:admin 密码:admin
设置新密码
http://s1.运维网.com/wyfs02/M01/83/2A/wKiom1dsBvGTP62gAACxBCqG6Zs941.png
首页
http://s2.运维网.com/wyfs02/M02/83/2A/wKiom1dsB0ui5Wn7AACI8kwtWc8792.png
【server2】
yum install -y net-snmp net-snmp-utils
/etc/init.d/snmpd startsnmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndexvim /etc/snmp/snmpd.confhttp://s4.运维网.com/wyfs02/M01/83/29/wKioL1dsB3Twj3A6AABLCTq_8wY288.png
http://s4.运维网.com/wyfs02/M00/83/29/wKioL1dsB3XjmycpAACA0dUnq_I996.png
http://s4.运维网.com/wyfs02/M01/83/29/wKioL1dsB9ijN0tqAABYYTqRjAY585.png
http://s3.运维网.com/wyfs02/M00/83/2A/wKiom1dsB5rShVTmAABbAM8_kjo570.png
http://s1.运维网.com/wyfs02/M01/83/2A/wKiom1dsB-_yCCGDAAATITz37xc318.png
/etc/init.d/snmpd restartsnmpwalk -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
http://s2.运维网.com/wyfs02/M02/83/29/wKioL1dsCFHh5snTAAAs47gBwcM180.png
【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 http://s5.运维网.com/wyfs02/M02/83/2A/wKiom1dsCTbDyXBHAAAYeAxy95A225.png
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 startsnmpwalk -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
http://s4.运维网.com/wyfs02/M01/83/29/wKioL1dsCiXBlPMSAAERtDyDY9M486.png
http://s4.运维网.com/wyfs02/M00/83/29/wKioL1dsCibyuNFLAAA22FY63lY348.png
http://s2.运维网.com/wyfs02/M01/83/29/wKioL1dsCpuBD_t2AANIe_cwIoA032.png
Graph Trees-Default Tree-Add
http://s4.运维网.com/wyfs02/M01/83/2A/wKiom1dsCq3CP4SlAAEAelihI8c851.png
http://s5.运维网.com/wyfs02/M00/83/29/wKioL1dsCaDTHp5lAAApRdNpHDA676.png
【server1】
cd /var/www/html/cacti/rra
rrdtool info server2_mem_free_16.rrd | lesshttp://s4.运维网.com/wyfs02/M02/83/2A/wKiom1dsCtDh8NaxAAC771iIdDg356.png
http://s2.运维网.com/wyfs02/M00/83/29/wKioL1dsCt-yx9YMAAAmKlR_0C0493.png
插件
所需软件包: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,密码为设置的密码
http://s1.运维网.com/wyfs02/M02/83/29/wKioL1dsCvqhI8OZAAAQ8_HkD6M307.png
su - cacti /usr/local/spine/bin/spine
SPINE: Using spine config file
SPINE: Version 0.8.8h starting
SPINE: Time: 0.1084 s, Threads: 5, Hosts: 3
http://172.25.45.1/cacti
Settings-Poller
http://s2.运维网.com/wyfs02/M02/83/2A/wKiom1dsCwezaeU2AACR0zM_g7I973.png
http://s2.运维网.com/wyfs02/M00/83/2A/wKiom1dsC5ai8Wh-AAAihIkC8hs473.png
cd /var/www/html/cacti/log
cat cacti.log
http://s2.运维网.com/wyfs02/M01/83/29/wKioL1dsC-XxXGahAAAewcOUwuw516.png
软件包: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
http://s1.运维网.com/wyfs02/M02/83/2A/wKiom1dsDEPRHfC2AAA-LIcLdvk105.png
http://s2.运维网.com/wyfs02/M01/83/29/wKioL1dsDGGT71s9AABCVutPVVo212.png
Settings-Misc
http://s4.运维网.com/wyfs02/M00/83/2A/wKiom1dsDHizTXTbAAB8fze8qn4853.png
http://s4.运维网.com/wyfs02/M01/83/2A/wKiom1dsDHjCXcmWAAApusY8q14353.png
页:
[1]