CentOS 6.0
架设流量监控及集中日志系统

第一章、cacti的安装

1、 系统的基本设置
2、 设置主机名
3、 [root@localhost ~]# vi /etc/sysconfig/network
4、 [root@localhost ~]# exit
5、 重新登陆
6、 [root@GZ-Cacti ~]#
7、 安装screen后台运行程序
yum -y install screen
8、 安装优秀的编辑器vim
yum -y install vim
9、 执行screen -S cacti进程进行安装程序防止断开远程导致安装中断

10、 cacti所需组件
http
Mysql
mysql-server
Php
Php-mysql
Php-snmp
php-cli
php-common
Perl-DBD-MySQL
Php-pdo
rrdtool
Net-snmp
Net-snmp-libs
Net-snmp-utils
rrdtool
yum安装这些组件
yum -y install httpd php php-mysql php-snmp php-cli php-common mysql mysql-server net-snmp net-snmp-libs net-snmp-utils php-pdo perl-DBD-MySQL rrdtool

#下载cacti
[root@GZ-cacti ~]# cd /home/
[root@GZ-cacti home]# wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz

#解压cacti
[root@GZ-cacti home]# tar xvf cacti-0.8.7g.tar.gz
#进入cacti文件夹,将里面的文件移动到/var/www/html/
[root@GZ-cacti home]# cd cacti-0.8.7g
[root@GZ-cacti cacti-0.8.7g]#
[root@GZ-cacti cacti-0.8.7g]# mv * /var/www/html/
#启动apache及mysql服务
[root@GZ-cacti cacti-0.8.7g]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 61.140.3.66 for ServerName
[ OK ]
[root@GZ-cacti cacti-0.8.7g]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@GZ-cacti cacti-0.8.7g]#

#并将apache、mysql及network加入自启动

# chkconfig --level 35 httpd on
# chkconfig --level 35 mysqld on
#chkconfig network on

建立数据库
mysql> create database cacti;
mysql> grant all privileges on cacti.* to cactiuser@localhost identified by 'cacti' with grant option;
mysql>flush privileges;

导入cacti数据库
[root@GZ-cacti cacti-0.8.7g]# mysql -h localhost -u cactiuser -p cacti </var/www/html/cacti.sql
Enter password:
[root@GZ-cacti cacti-0.8.7g]#

修改cacti配置文件

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
$database_port = "3306";

#$cacti_session_name = "Cacti";

暂时关闭防火墙
/etc/init.d/iptables stop

检查SELinux现时况态

要知到你现在是否使用 SELinux:

# getenforce
enforcing

关闭selinux
修改档案/etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted.NETwork daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

把 SELINUX设定为disable, 下次启动系统后将会停止SElinux。

# getenforce
disable

进入安装界面
http://(cacti-ip)/install/index.php
确保每个路径都正确点击下一步完成安装

配置snmp
vi /etc/snmp/snmp.conf
(7)配置snmp
vi /etc/snmp/snmp.conf
#将下边这行中的default
com2secnotConfigUser default public

#改为127.0.0.1
com2secnotConfigUser 127.0.0.1 Cacti

#将下边这行中的systemview
access notConfigGroup "" any noauth exact systemview none none

#改为all
access notConfigGroup "" any noauth exact all none none

#将下边这行的注释“#”号去掉
#view all included .1 80

#重启snmpd服务
service snmpd restart

用这个命令进行测试能抓取信息为配置正确
snmpwalk -v 1 localhost -c Cacti

安装ntpdate并且停用自动更新
yum -y install ntpdate
/etc/init.d/ntpdate stop
chkconfig ntpdate off

以cacituser用户增加入一个计划任务,使得 cacti 每五分钟生成一个监控图表。
crontab -e

#加入如下内容。注意poller.php的路径
*/5 * * * * php /var/www/html/poller.php > /dev/null 2>&1

时间同步命令,每十分钟跟因特网同步时钟
*/10 * * * * ntpdate 210.72.145.44 > /dev/null 2>&1
并将rra和log文件夹赋予cactiuser以读写权限,poller.php文件赋予cactiuser用户运行权限
[cactiuser@localhost html]$ chmod 777 rra
[cactiuser@localhost html]$ chmod 777 log
[cactiuser@localhost html]$ chmod 755 poller.php

至此cacti安装完成,稍等五分钟刷新一下就可以出图

本文出自 “明日灵感” 博客,请务必保留此出处http://coolner.blog.51cto.com/957576/688164

Cacti安装教程的更多相关文章

  1. cacti安装

    cacti是一套基于PHP,MySQL,Net-SNMP及RRDTool开发的网络流量监测图形分析工具.它通snmpget来获取数据,使用RRDtool绘画图形,提供了非常强大的数据和用户管理功能,同 ...

  2. Linux+apache+mono+asp.net安装教程

    Linux+apache+mono+asp.net安装教程(CentOS上测试的) 一.准备工作: 1.安装linux系统(CentOS,这个就不多讲了) 2.下载所需软件 http-2.4.4.ta ...

  3. Greenplum 源码安装教程 —— 以 CentOS 平台为例

    Greenplum 源码安装教程 作者:Arthur_Qin 禾众 Greenplum 主体以及orca ( 新一代优化器 ) 的代码以可以从 Github 上下载.如果不打算查看代码,想下载编译好的 ...

  4. cacti 安装

    cacti:是常用的一个监控软件(开源,免费) 特点:重图形,有数据历史,需要用到数据库的支持,支持web配置,默认不支持告警,可以加插件 cacti安装 1.安装扩展源epel (nagios 和z ...

  5. git 安装教程

    昆,简单说下安装教程1,安装Git2,安装TortoiseGit3,打开第一步安装的git工具GIT BASH

  6. CentOS7 cacti 安装

    首先centos7 web环境的安装这里就不说了.安装cacti,首先得web环境配置好 其次添加两个用户,一个是cacti用于操作mysql的 cactimysql  一个是cacti操作Linux ...

  7. Docker和Docker-compose安装教程以及docker-elk,docker-storm安装教程

    此安装教程仅供我自己安装配置时查看,其他的人不可以偷看!!! 安装Docker 1. Update package information, ensure that APT works with th ...

  8. RHEL 6.3 详细安装教程

    以前刚接触linux时,什么都不懂,为了学习,在电脑上安装双系统(原系统为Win7),吃过不少苦头,在网上搜教程,很多都是语焉不详,导致安装过程中战战兢兢.最近朋友面试运维,面试官有考他对linux安 ...

  9. Android Studio的下载和安装教程(从ADT到AS)

    之前一直使用的是Android development tools(简称ADT),后来说是google对ADT不再提供支持,然后一直在考虑是否把自己电脑换成Android Studio(简称AS),从 ...

随机推荐

  1. Sleep的问题

    先上全部源码: using System; using System.Threading; namespace MoveServices { public static class MoveWorke ...

  2. Linux Weblogic 数据源 TimesTen配置

    [wzh@localhost middleware]$ vi wlserver_10.3/common/bin/commEnv.sh [Linux] LD_LIBRARY_PATH=${PATCH_L ...

  3. Android Service之LOCATION_SERVICE

    Android提供了GPS功能 LocationManager obj = (LocationManager)getSystemService(Context.LOCATION_SERVICE) Pe ...

  4. SlidingMenu和ActionBarSherlock结合滑动式菜单都

    https://github.com/jfeinstein10/SlidingMenu http://actionbarsherlock.com/ SlidingMenu 的demo工程引用了Acti ...

  5. 【HDOJ】2772 Matchsticks

    纯粹的找规律题.1: 22: 53: 54: 45: 56: 67: 38: 79: 60: 6 2     1     13     7     74     4    115     2      ...

  6. UVAlive3211 Now or later(2-SAT)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=33799 [思路] 2-SAT. 二分安全间隔x,先到为1后到为0, ...

  7. Java 中 Vector、ArrayList、List 使用深入剖析【转载】

    线性表,链表,哈希表是常用的数据结构,在进行Java开发时,JDK已经为我们提供了一系列相应的类来实现基本的数据结构.这些类均在java.util包中.本文试图通过简单的描述,向读者阐述各个类的作用以 ...

  8. Struts2初学习记录

    以下笔记内容来自尚硅谷_Struts2_佟刚老师的视频教程+自己一点点整理 来源免责声明 一. 1. VS 自实现: 1). 搭建 Struts2 的开发环境 2). 不需要显式的定义 Filter, ...

  9. (转)Maven实战(三)Eclipse构建Maven项目

    1. 安装m2eclipse插件    要用Eclipse构建Maven项目,我们需要先安装meeclipse插件    点击eclipse菜单栏Help->Eclipse Marketplac ...

  10. Java字符串的最大长度

    在cpp中为了可移植性,string的长度是string::size_type,突然就想知道java允许的最大字符串长度为多少.看String的源码: public final class Strin ...