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. Day2 数据类型

    1.数字:int(整型) 32位机器:-2**31~2**31-1 64位机器:-2**63~2**63-1 float(浮点型) 2.布尔值 真或假 1或0 bool(0) 3.字符串 name = ...

  2. iTunes 安装终极解决方案

    近日手贱升级了Itunes,升级过程即报失败,然后卸载所有相关东西,再重装,Itunes安装成功,但是报告无法使用iphone,经过几天摸索,发现是Apple Mobile Device Suppor ...

  3. ARC下的内存泄露

    iOS提供了ARC功能,很大程度上简化了内存管理的代码. 但使用ARC并不代表了不会发生内存泄露,使用不当照样会发生内存泄露. 下面列举两种ARC导致内存泄露的情况. 1,循环参照 A有个属性参照B, ...

  4. ISO15693协议的Inventory

    ISO15693的Inventory指令看起来比较让人迷糊,想明白其流程,我认为以下几点是必须了解的: 第一.ISO15693标签的几种状态,资料上有,这里罗嗦重复一下: 1.PowerOff状态 2 ...

  5. [置顶] Guava学习之ArrayListMultimap

    ArrayListMultimap类的继承关系如下图所示: Guava ArrayListMultimap List Multimap 是一个接口,继承自 Multimap 接口.ListMultim ...

  6. 【HDOJ】4857 逃生

    很容易想到优先队列+拓扑排序.关键点是有限制条件者有限,无限制条件者在最后,条件相同者按序输出.因此采用逆序. #include <iostream> #include <queue ...

  7. POJ1836 Alignment(LIS)

    题目链接. 分析: 从左向右求一遍LIS,再从右向左求一遍LIS,最后一综合,就OK了. 注意: 有一种特殊情况(详见discuss): 8 3 4 5 1 2 5 4 3 答案是:2 AC代码如下: ...

  8. bzoj3028食物

    http://www.lydsy.com/JudgeOnline/problem.php?id=3028 好吧,这是我第一道生成函数的题目. 先搞出各种食物的生成函数: 汉堡:$1+x^2+x^4+. ...

  9. MySQL数据库的安装

    官方下载地址: http://downloads.mysql.com/archives/community/ msi为安装版,zip为免安装版,最新版本的MySQL没有64位windows的msi版囧 ...

  10. 《算法问题实战策略》-chaper7-穷举法

    关于这一章节<算法实战策略>有一段概述问题,我认为对于编程人员来说非常有价值,故在这里进行如下的摘抄: 构想算法是很艰难的工作.相比大家都经历过,面对复杂的要求只是傻乎乎地盯着显示器,或者 ...