关闭selinux

1.搭建lamp环境

配置apache

[root@cacti-server ~]# yum -y install httpd

[root@cacti-server ~]# systemctl start httpd

[root@cacti-server ~]# systemctl enable httpd

[root@cacti-server ~]# firewall-cmd --permanent --add-service=http

success

[root@cacti-server ~]# firewall-cmd --reload

success

配置mariadb

[root@cacti-server ~]# yum -y install mariadb-server mysql-devel

[root@cacti-server ~]# systemctl start mariadb

[root@cacti-server ~]# mysql_secure_installation

Set root password? [Y/n]

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

[root@cacti-server ~]# mysql -u root -p

MariaDB [(none)]> grant all privileges on *.* to test@localhost identified by 'redhat'; 创建用于测试php和mariadb连通性的用户

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;

[root@cacti-server ~]# systemctl restart mariadb

[root@cacti-server ~]# systemctl enable mariadb

[root@cacti-server ~]# firewall-cmd --permanent --add-port=3306/tcp

success

[root@cacti-server ~]# firewall-cmd --reload

success

配置php

[root@cacti-server ~]# yum -y install php php-mysql php-gd php-pear

[root@cacti-server ~]# vim /etc/php.ini

date.timezone =PRC      修改时区

[root@cacti-server ~]# vim /var/www/html/index.php    编辑测试页面

<?php

$conn=mysql_connect('localhost','test','redhat');

if ($conn)

echo "database connect ok";

else

echo "database connect failure";

?>

<?php

phpinfo()

?>

[root@cacti-server ~]# systemctl restart httpd

测试

2.安装配置cacti

下载软件

[root@cacti-server ~]# cd /usr/local/src/

[root@cacti-server src]# wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz

[root@cacti-server src]# tar zxvf cacti-0.8.8f.tar.gz

[root@cacti-server src]# mv cacti-0.8.8f /var/www/html/cacti

创建cacti数据库和cacti用户,赋予权限

[root@cacti-server ~]# mysql -u root -p

MariaDB [(none)]> create database cacti default character set utf8;

MariaDB [(none)]> grant all privileges on cacti.* to cacti@localhost identified by 'redhat';

MariaDB [(none)]> flush privileges;

把cacti.sql导入数据库

[root@cacti-server cacti]# mysql -ucacti -predhat cacti < /var/www/html/cacti/cacti.sql

编辑config.php和global.php

[root@cacti-server cacti]# vim /var/www/html/cacti/include/config.php|global.php

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cacti";

$database_password = "redhat";

$database_port = "3306";

$database_ssl = false;

安装rrdtool以生成图像

[root@cacti-server src]# yum -y install rrdtool rrdtool-devel rrdtool-php rrdtool-perl

[root@cacti-server src]# yum -y install gd gd-devel php-gd    ---rrdtool绘制图像需要的图形库

安装snmp服务

[root@cacti-server cacti]# yum -y install net-snmp net-snmp-utils php-snmp net-snmp-libs

编辑配置文件

[root@cacti-server ~]# vim /etc/snmp/snmpd.conf

41  com2sec notConfigUser  127.0.0.1      public

62  access  notConfigGroup ""  any    noauth    exact  all none none

85  view all    included  .1          80

[root@cacti-server ~]# systemctl restart snmpd.service

[root@cacti-server ~]# systemctl enable snmpd.service

授权目录权限

[root@cacti-server ~]# useradd -r -M cacti

[root@cacti-server ~]# chown -R cacti /var/www/html/cacti/rra/

[root@cacti-server ~]# chown -R cacti /var/www/html/cacti/log/

配置一个抓图的计划任务

[root@cacti-server ~]# crontab -e

*/5 * * * * /usr/bin/php  /var/www/html/cacti/poller.php >> /tmp/cacti_rrdtool.log

浏览器访问cacti管理页面进行安装

[root@cacti-server ~]# /usr/bin/php /var/www/html/cacti/poller.php

OK u:0.00 s:0.01 r:0.80

OK u:0.00 s:0.02 r:1.21

OK u:0.00 s:0.02 r:1.39

OK u:0.00 s:0.02 r:1.50

OK u:0.00 s:0.02 r:1.87

10/21/2016 04:02:32 PM - SYSTEM STATS: Time:1.4211 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:5

cacti安装和使用的更多相关文章

  1. cacti 安装

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

  2. CentOS7 cacti 安装

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

  3. ubuntu下cacti安装配置

    参考文献 http://kling.blog.51cto.com/3320545/1180778 前言: 原本是想源码安装的,但是现在发现还是太麻烦了,就直接通过apt-get install安装了. ...

  4. Cacti安装教程

    CentOS 6.0架设流量监控及集中日志系统 第一章.cacti的安装 1. 系统的基本设置2. 设置主机名3. [root@localhost ~]# vi /etc/sysconfig/netw ...

  5. 性能监控工具——Cacti安装文档

    一.Cacti安装说明 1.安装说明 一般性的安装说明,详细的操作系统具体的安装说明可用于Linux. 2.服务器安装要求 RRDTool 1.2.x或更高版本 MySQL 4.1.x或5.x更高版本 ...

  6. cacti安装

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

  7. CentOS 6.6下Cacti安装部署

    Cacti简介 本章结构 常见平台 常见的服务器监控软件 cacti,流量与性能监测为主----http://www.cacti.net/ nagios,服务与性能监测为主---http://www. ...

  8. cacti 安装与 与不能显示图像故障解决方案

    on debian 7&8 apt-get install snmp snmpd apt-get install cacti cacti-spine apt-get install moreu ...

  9. 企业级监控工具Cacti安装配置全过程

      Cacti 在英文中的意思是仙人掌的意思,Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具.它通过 snmpget来获取数据,使用 RRDtool绘画 ...

  10. Cacti 安装插件

            Cacti本身可以以图形化界面显示出流量状态,cacti也可以安装插件,通过插件,cacti的功能被进一步强大:可以监控服务器状态:发送邮件通知:短信通知等.        0.88之 ...

随机推荐

  1. [Windows Powershell]-学习笔记(2)

    数学运算 我们可以把powershell当成一个计算器.如键入命令行那样输入数学表达式,回车,powershell会自动计算并把结果输出.常用的加减乘除模(+,-,*,/,%)运算和小括号表达式都支持 ...

  2. UVALive - 4671 K-neighbor substrings (FFT+哈希)

    题意:海明距离的定义:两个相同长度的字符串中不同的字符数.现给出母串A和模式串B,求A中有多少与B海明距离<=k的不同子串 分析:将字符a视作1,b视作0.则A与B中都是a的位置乘积是1.现将B ...

  3. Python之路——堡垒机原理及其简单实现

    1 堡垒机基本概述 其从功能上讲,它综合了核心系统运维和安全审计管控两大主干功能,从技术实现上讲,通过切断终端计算机对网络和服务器资源的直接访问,而采用协议代理的方式,接管了终端计算机对网络和服务器的 ...

  4. java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 异常处理,及MySQL数据库编码设置

    java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,C ...

  5. 并发容器-ConcurrentHashMap,CopyOnWriteArrayList

    ConcurrentHashMap HashMap是线程非安全的,在多线程环境下,采用的是Fail-Fast快速失败机制,即当A线程在访问容器的时候,如果此时B线程修改了HashMap的结构,那么就会 ...

  6. 20145316《Java程序设计》实验二报告

    20145316<Java程序设计>实验二报告 一.实验目的与要求 1.初步掌握单元测试和TDD. 2.理解并掌握面向对象三要素:封装.继承.多态. 3.初步掌握UML建模. 4.熟悉S. ...

  7. CSS Outline(轮廓)

    CSS Outline(轮廓) 一.CSS 轮廓(outline) 轮廓(outline)是绘制于元素周围的一条线,位于边框边缘的外围,可起到突出元素的作用. CSS outline 属性规定元素轮廓 ...

  8. Statement与PreparedStatement

    Statement 用于通用查询,能批处理 PreparedStatement(简称PS) 用于执行参数化查询,能批处理 什么是参数化查询? 指在设计与数据库链接并访问数据时,在需要填入数值或数据的地 ...

  9. LeetCode——Largest Rectangle in Histogram

    Question Given n non-negative integers representing the histogram's bar height where the width of ea ...

  10. NAT模式下远程连接centos6虚拟机与虚拟机网络配置

    最近装了centos,但是没有网络,也无法远程连接.关键是虚拟机中没有ip地址. 网上方法很多,但是每个人情况不一样,所以不尽适用. 1.解决这个问题,首先保证你的vmware的dhcp服务和net服 ...