Redhat 5.8 安装cacti 0.8.8c

一、Cacti简介

Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具。

简单的说Cacti 就是一个PHP 程序。它通过使用SNMP 协议获取远端网络设备和相关信息,(其实就是使用Net-SNMP 软件包的snmpget 和snmpwalk 命令获取)并通过Rrdtool 工具绘图,通过PHP 程序展现出来。我们使用它可以展现出监控对象一段时间内的状态或者性能趋势图。

二、准备和配置

1.准备所需要的软件包,apache、mysql、php、snmp通过yum安装

Rrdtool官网:http://oss.oetiker.ch/rrdtool/

Cacti官网:http://www.cacti.net/

[[email protected] ~]#yum -y install httpd

[[email protected] ~]#yum -y install mysql mysql-server mysql-devel

[[email protected] ~]#yum -y install php php-devel php-mysql php-pdo php-gd

[[email protected] ~]#yum -y install net-snmp php-snmp net-snmp-utils net-snmp-devel net-snmp-perl

[[email protected] ~]#yum -y install gcc gcc-c++

[[email protected] ~]#yum -y install libxml2-devel

[[email protected] ~]#yum -y install pango-devel pango

报错:由于我的yum不能安装这两个文件,我用光盘装了下

pango-devel-1.14.9-8.el5.centos.3.i386 from base has depsolving problems

--> Missing Dependency: pango = 1.14.9-8.el5.centos.3 is needed by package pango-devel-1.14.9-8.el5.centos.3.i386 (base)

Error: Missing Dependency: pango = 1.14.9-8.el5.centos.3 is needed by package pango-devel-1.14.9-8.el5.centos.3.i386 (base)

You could try using --skip-broken to work around the problem

You could try running: package-cleanup --problems

package-cleanup --dupes

rpm -Va --nofiles --nodigest

挂载光盘到/mnt下

[[email protected] ~]#mount /dev/cdrom /mnt/

[[email protected] ~]#  find /mnt/ -name "pango*rpm"

[[email protected] ~]#/mnt/CentOS/pango-1.14.9-6.el5.centos.i386.rpm

[[email protected] ~]#/mnt/CentOS/pango-devel-1.14.9-6.el5.centos.i386.rpm

[[email protected] ~]#rpm -ivh /mnt/CentOS/pango-1.14.9-6.el5.centos.i386.rpm

[[email protected] ~]#rpm -ivh /mnt/CentOS/pango-devel-1.14.9-6.el5.centos.i386.rpm

又报错,这是因为有依赖关系

[[email protected]alhost ~]# rpm -ivh /mnt/CentOS/pango-devel-1.14.9-6.el5.centos.i386.rpm

error: Failed dependencies:

cairo-devel >= 1.2.2 is needed by pango-devel-1.14.9-6.el5.centos.i386

fontconfig-devel >= 2.0 is needed by pango-devel-1.14.9-6.el5.centos.i386

freetype-devel >= 2.1.3-3 is needed by pango-devel-1.14.9-6.el5.centos.i386

glib2-devel >= 2.12.0-1 is needed by pango-devel-1.14.9-6.el5.centos.i386

libX11-devel is needed by pango-devel-1.14.9-6.el5.centos.i386

libXext-devel is needed by pango-devel-1.14.9-6.el5.centos.i386

libXft-devel is needed by pango-devel-1.14.9-6.el5.centos.i386

libXrender-devel is needed by pango-devel-1.14.9-6.el5.centos.i386

[[email protected] ~]#yum -y install cairo-devel fontconfig-devel freetype-devel glib2-devel libX11-devel libXext-devel libXft-devel libXrender-devel

继续安装

[[email protected] ~]#rpm -ivh /mnt/CentOS/pango-devel-1.14.9-6.el5.centos.i386.rpm

2.安装rrdtool

[[email protected] ~]#tar zxvf rrdtool-1.4.5.tar.gz

[[email protected] ~]#cd rrdtool-1.4.5

[[email protected] ~]#./configure --prefix=/usr/local/rrdtool

[[email protected] ~]#make && make install

[[email protected] ~]#ln -s /usr/local/rrdtool/bin/* /usr/local/bin/

3.安装cacti

[[email protected] ~]#tar zxvf cacti-0.8.8c.tar.gz

[[email protected] ~]#useradd -d /var/www/html/cacti cacti -s /sbin/nologin

[[email protected] ~]#mv cacti-0.8.8c/*  /var/www/html/cacti

[[email protected] ~]#chown -R cacti:cacti /var/www/html/cacti

[[email protected] ~]#chmod 755 -R /var/www/html/cacti

4.安装轮询器:cacti-spine

[[email protected] ~]#tar zxvf cacti-spine-0.8.8c.tar.gz

[[email protected] ~]#cd cacti-spine-0.8.8c

[[email protected] ~]#./configure --prefix=/usr/local/spine

[[email protected] ~]#make && make install

报错:

[[email protected] cacti-spine-0.8.8c]# ./configure --prefix=/usr/local/spine

checking build system type... i686-pc-linux-gnu

checking host system type... i686-pc-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... configure: error: newly created file is older than distributed files!

Check your system clock

设置时间2015年3月6号16:21

[[email protected] ~]# date -s "2015-03-06 16:21:40"

修改完后,输入:[[email protected] ~]#clock -w

把系统时间写入CMOS

5.拷贝配置文件

[[email protected] ~]#cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf

6.重启服务

[[email protected] ~]#service httpd restart

[[email protected] ~]#service snmpd restart

[[email protected] ~]#service mysqld restart

7.修改mysql的root密码

[[email protected] ~]#/etc/init.d/mysqld start

修改mysql root密码为123456

[[email protected] ~]#mysqladmin -u root password "123456"

登录mysql测试

[[email protected] ~]#mysql -uroot -p123456

8.配置并导入数据库

mysql> create database cacti default character set utf8;

mysql> GRANT ALL privileges ON cacti.* TO [email protected] IDENTIFIED BY ‘123456‘;

mysql> flush privileges;

[[email protected] ~]# mysql -uroot -p cacti</var/www/html/cacti/cacti.sql

9.修改php配置文件

[[email protected] ~]#vi /etc/php.ini

添加时区: date.timezone = Asia/ShangHai

定时计划任务(这里很重要,出错了可能会导致你的网页监控刷新不了)

*/1 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /var/log/cacti.log 2>&1

10.修改cacti配置文件

[[email protected] ~]#vi /var/www/html/cacti/include/config.php

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cacti";

$database_password = "123456";

$database_port = "3306";

$database_ssl = false;

11.修改轮训器配置文件:

# vi /usr/local/spine/etc/spine.conf

DB_Host localhost

DB_Database cacti

DB_User cacti

DB_Pass 123456

DB_Port 3306

DB_PreG 0

12.设置selinux为disabled

[[email protected] ~]# cat /etc/selinux/config

[[email protected] ~]#setenforce 0

13.访问web

http://192.168.88.150/cacti/

安装完成,默认用户名和密码是admin,第一次登录会要求更改密码

14.出图要等一会的

查看如果有图,没有曲线,重启apache,/usr/bin/php /var/www/html/cacti/poller.php

tail -f /var/log/messages

三、配置被监控Linux主机

1.在被监控主机上

[[email protected] ~]#egrep -v "^$|#" /etc/snmp/snmpd.conf

com2sec notConfigUser default public

group notConfigGroup v1 notConfigUser

group notConfigGroup v2c notConfigUser

view systemview included .1.3.6.1.2.1.1

view systemview included .1.3.6.1.2.1.25.1.1

access notConfigGroup "" any noauth exact all none none

view all included .1 80

syslocation Unknown (edit /etc/snmp/snmpd.conf)

syscontact Root <[email protected]> (configure /etc/snmp/snmp.local.conf)

dontLogTCPWrappersConnects yes

2.重启snmpd服务

[[email protected] ~]#service snmpd restart

四、图形界面配置可以参考下面链接

http://www.linuxidc.com/Linux/2012-07/66918.htm

时间: 2024-10-14 13:29:06

Redhat 5.8 安装cacti 0.8.8c的相关文章

自动化安装Cacti 0.8.8h脚本

自动化安装Cacti 0.8.8h脚本 一.目的 1.1 监控目的 目前我们已经有zabbix监控系统,但是有客户需求需要流量报表,因此应此类客户的需求,部署Cacti流量监控系统,来监控客户服务器或交换机端口,为客户提供流量报表截图. 1.2 本文目的 快速部署Cacti流量监控系统,为后期相关工程师部署此系统提供借鉴与参考. 二.理论基础 2.1 相关理论 Cacti是用php语言实现的一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具.snmp服务获取数据,

redhat6.5安装cacti监控及安装过程中的问题解决

课题描述:在redhat系统中安装cacti这款通用的监控工具. 环境描述:我的客户端使用的win7的系统,通过putty远程登录Linux服务器 客户端IP:192.168.0.23,Linux服务器IP:192.168.0.56(使用的是内网) cacti原理:cacti本身是一个PHP脚本,它的所有功能都是由其插件完成的,cacti通过snmp协议与被监控主机取得通信,被监控主机的监控参数保存在cacti目录下的一个rra文件中,通过rrdtool这个工具定时地到这个文件中读取数据,然后做

cacti 0.8.8h 一键安装脚本

cacti 0.8.8h 一键安装脚本 cacti rrdtool # cacti 0.8.8h 一键安装脚本 # Make by Fenei # E-Mail : [email protected] # Date : 13-Sep-2016 # URL:http://babyfenei.blog.51cto.com/443861/1852324 #----------------------------------------------------- # 本脚本自动安装 cacti0.8.8

Cacti 0.8.8b 安装配置(含snmp配置)

类别:原创 服务器 本文参考 第一:说明 目的:   安装cacti并配置. 其它说明: 操作系统为:centos 6.6 64位, cactiserver的ip为:192.168.10.112,测试服务器为:192.168.1.4(windows) 第二:本例操作环境  [[email protected]~]# yum update -y [[email protected] ~]# uname -a Linux i-tcz0hdhc 2.6.32-431.29.2.el6.x86_64#1

Centos 6安装Cacti监控网络流量

Centos 6安装Cacti监控网络流量 1.操作系统的安装,这个就不用写教程了吧(略)我个人用的是CentOS6.5最小化安装装好系统以后关闭防火墙和selinux#service iptables stop     /*关闭防火墙服务*/#chkconfig iptables off    /*永久性关闭*/ #vim /etc/sysconfig/selinux   /*把SELINUX=enforcing改为SELINUX=disabled*/ 2.安装cacti依赖的软件 #yum

cacti 0.8.8h 一键安装包

cacti 0.8.8h 一键安装脚本 此脚本集成所有最新cacti版本及最新常用插件 包含有thold settings syslog clog monitor等最新插件 rrdtool支持中文字体及中文标题 默认安装为rrdtool1.3版本 脚本中通过yum本地安装了编译了水印的rrdtool的rpm文件.可根据需求增删 rrdtool修改水印教程 注意:此教程中thold的模版目前无法正常引用,正在寻求解决办法 # cacti 0.8.8h 一键安装脚本 # Make by Fenei

CentOs安装cacti

虚拟机地址 192.168.24.69, 附件中的三个文件可以用SSH FILE工具上传到root文件夹下,方便后续操作 一.安装所需要的软件(1)在主监控机上安装apache+php+gd的web环境,推荐编译安装,在此直接用yum安装. #yum install -y php php-mysql php-snmp mysql mysql-server net-snmp net-snmp-libs net-snmp-utils php-pdo perl-DBD-MySQL(2)在主监控机上安装

centos6.5安装cacti监控(一)

1:操作系统的安装,这个就不用写教程了吧(略)我个人用的是CentOS6.5最小化安装 装好系统以后关闭防火墙和selinux [[email protected] ~]#service iptables stop     //关闭防火墙服务 [[email protected] ~]#chkconfig iptables off    //永久性关闭 [[email protected] ~]#vi /etc/sysconfig/selinux   //把SELINUX=enforcing改为

Centos6.8安装cacti

cacti环境基于LAMP,本实验LAMP环境已编译安装成功.若直接yum安装cacti环境会把httpd,mysql,php也yum安装,与我们编译安装的LAMP环境造成冲突,所以本次实验只安装cacti,rrdtool,net-snmp. 安装rrdtool yum -y install rrdtool 安装net-snmp yum -y install net-snmp 编辑net-snmp配置文件 vim /etc/snmp/snmpd.conf +55 #修改: view system