码迷,mamicode.com
首页 > 其他好文 > 详细

(十)企业部分之cacti

时间:2016-06-24 07:03:21      阅读:379      评论:0      收藏:0      [点我收藏+]

标签: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

29database_username改为cacti

30database_password改为westoscacti用户密码)

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_Usercacti,密码为设置的密码

技术分享

 

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

标签:cacti

原文地址:http://wjl19940429.blog.51cto.com/11354210/1792394

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!