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

Enter password:

[root@GZ-cacti cacti-0.8.7g]#

修改cacti配置文件

/* make sure these values refect your actual database/host/user/password */

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cactiuser";

$database_password = "cacti";

$database_port = "3306";

/* Default session name - Session name must contain alpha characters */

#$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安装完成,稍等五分钟刷新一下就可以出图

11、报错处理

1)/usr/bin/ld: cannot find -lmysqlclient 解决方法

原因是GCC 的默认搜索没有包含 /usr/lib/mysql

解决方法:

执行   export LIBRARY_PATH=/usr/lib/mysql

2)# make

false // No help2man // --output=spine.1 --name='Data Collector for Cacti' --no-info --version-option='--version' ./spine

make: *** [spine.1] Error 1报错

解决办法

需安装help2man解决

#yum -y install help2man

3)ERROR: Your

Cacti database login account does not haveaccess to the MySQL TimeZone

database. Please provide the Cacti databaseaccount "select" access to

the "time_zone_name" table inthe "mysql" database, and populate MySQL's

TimeZone informationbefore proceeding

错误解决办法

# grant all privileges on *.* to cacti@localhost identified by 'cacti';

# flush privileges;

4)ERROR: Your MySQL TimeZone database is not populated.Please populate this database  before proceeding.

解决办法# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

12、参考资料

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

Cacti官网论坛:http://forums.cacti.net/

Cacti文档:http://docs.cacti.net/

Cacti插件:http://cactiusers.org/index.php

Network Weathermap:http://www.network-weathermap.com/

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

NET-SNMP官方网站:http://www.net-snmp.org/

Apache官网:http://httpd.apache.org/

MySQL官网:http://www.mysql.com/

PHP官网:http://www.php.net/

linux cacti安装教程,cacti安装教程相关推荐

  1. Linux redis安装教程,Linux 下redis5.0.0安装教程详解

    Linux redis5.0.0安装,教程如下所示: 1.从官网下载,然后传到服务器,tar -zxvf解压 2.进入redis ? 3.安装:make, (1)若提示:: gcc: Command ...

  2. linux系统安装nginx步骤,虚拟机(linux)下安装nginx的步骤教程

    原标题:虚拟机(linux)下安装nginx的步骤教程 一.虚拟机准备: [root@localhost 桌面]# vi /etc/sysconfig/network-s/ifcfg-eth0 DEV ...

  3. linux安装 Android Studio详细教程,支持性较差,需要安装最新底层库内核的linux

    安装 Android Studio详细教程 libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 jdk1.8.0_25 android-st ...

  4. debian linux u盘安装,使用U盘安装Debian系统图文教程

    习惯了使用图形界面的操作,总有一股想要切换到文字界面的Linux的冲动,这次尝试安装Debain系统,在一路安装与使用的过程中,碰到了许多的问题.本文U盘安装Debain系统教程,希望可以帮到需要的人 ...

  5. Linux下的docker容器安装教程

    Linux下的docker容器安装教程 一.初始环境配置 1.yum仓库配置 2.检查yum仓库 3.关闭防火墙和selinux 二.开启内核的流量转发 三.安装docker 1.配置docker相关 ...

  6. Linux服务器下安装配置Nginx的教程

    这篇文章主要介绍了Linux服务器下安装配置Nginx服务器的教程,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下 Nginx("engine x")是一款 ...

  7. 【笔记】windows10安装linux(ubuntu)双系统教程(可能是现今最简单方法)

    这周测试成功了大牛漂移菌教的树莓派系统镜像的压缩方法([树莓派]不只是一封感谢信!漂移菌手把手指导:小空间树莓派镜像系统备份方法),虚拟机下备份镜像不太方便,无论是存储空间还是读卡操作都不方便.所以打 ...

  8. linux centos7 安装最新版git 教程

    2019独角兽企业重金招聘Python工程师标准>>> linux centos7 安装最新版git 教程 2018年08月22日 11:53:59 alisen169 阅读数:13 ...

  9. linux运维最小化安装cacti,Linux监控和安全运维--cacti安装部署

    cacti安装 [root@client~]# rpm -ivh http://www.aminglinux.com/bbs/data/p_w_upload/forum/month_1211/epel ...

  10. Linux系统CUDA10.2+CUDNN安装教程

    这里主要针对驱动已经安装好了的环境,如何安装合适的显卡驱动这里不多赘述,本文演示的系统为Ubuntu18.04,但理论上其他Linux发行版操作类似. 驱动适配 通过命令行输入nvidia-smi查看 ...

最新文章

  1. 用C++的random_shuffle()函数打乱int数组顺序
  2. iOS 使用Quartz 2D画虚线 .
  3. android doGet和doPost
  4. 也许你所知道的学习方法都是错的
  5. Java黑皮书课后题第10章:**10.28(实现StringBuilder类)在Java库中提供了StringBuilder类。给出你对下面方法的实现(将新类命名为MyStringBuilder2)
  6. oracle record 遍历,ORACLE中RECORD、VARRAY、TABLE的使用详解
  7. c与python 数据传递-详解python如何调用C/C++底层库与互相传值
  8. 阿里云服务器mysql莫名丢失_mysql数据库丢失
  9. php元素浮动会产生哪些影响,css浮动带来什么问题
  10. HTML5 API详解(15):History 不刷新也可以实现网页跳转
  11. 苹果折叠屏iPhone不会在明年推出 最快2025年出货
  12. 机器人建模中移动关节如何建立坐标系_机器人标准DH建模法
  13. java(21) - 注解详解
  14. java截取字符串函数
  15. 分享一款灵动微MM32F0010A1T兼容替换STM8S003F3P6
  16. Coverity代码静态检测工具介绍
  17. AD19原理图的设计流程
  18. 【vue+cesium】加载三维天地图
  19. [Android O] [RK3399] -- Vendor Storage 功能探究
  20. 未来,你会反感虚拟现实沉浸式广告吗?

热门文章

  1. 雨林木风团队宣布解散
  2. 单源最短路径---Dijkstra算法
  3. 5.9java-new
  4. SVN提示Checksum mismatch for expected: , actual:
  5. 5-10 公路村村通 (30分)
  6. Windows下载安装Nmap及Zenmap使用教程
  7. app测试(二)——常用APP命令
  8. 互联网进军影视作品的软广告
  9. 一起谈.NET技术,梦想创造可能——盘点微软 .NET 技术八年发展历程
  10. Win系统 - 显存反映了显卡的全部性能?