企业部分之cacti

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了企业部分之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 [email protected] 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 [email protected]:/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的主要内容,如果未能解决你的问题,请参考以下文章

(?)企业部分之puppet

(?)企业部分之HA集群

企业部分之Varnish

企业部分之nginx(未完)

(?)企业部分之ganglia(未完)

(?)企业部分之nagios(未完)