关闭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. 62. Unique Paths (走棋盘多少种不同的走法 动态规划)

    A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The ...

  2. 受限的用户shell环境

    有些特殊情况下需要实现将系统内普通用户限定在指定目录下,并且只能使用系统管理员设定的命令.lshell就是实现这样功能的一个神器. lshell提供了一个针对每个用户可配置的限制性shell,lshe ...

  3. Divide by Zero 2017 and Codeforces Round #399 (Div. 1 + Div. 2, combined) D. Jon and Orbs

    地址:http://codeforces.com/contest/768/problem/D 题目: D. Jon and Orbs time limit per test 2 seconds mem ...

  4. Winter-1-A A + B 解题报告及测试数据

    Time Limit:1000MS Memory Limit:32768KB Description Calculate A + B. Input Each line will contain two ...

  5. Docker+.Net Core 的那些事儿-2.创建Docker镜像

    1.从store.docker.com获取.net core镜像 docker pull microsoft/dotnet 2.创建一个.net core项目,并发布 在上篇文章结尾建立的工作目录下, ...

  6. CSS清除浮动大全的8种方法

    清除浮动是每一个 web前台设计师必须掌握的机能.css清除浮动大全,共8种方法. 浮动会使当前标签产生向上浮的效果,同时会影响到前后标签.父级标签的位置及 width height 属性.而且同样的 ...

  7. servlet类与Spring Controller类的关系

    以前的java web项目,需要在web.xml中定义servlet,对应不同的请求,而在spring项目中,我们用controller定义了各种各样的servlet(当然不包括DispatcherS ...

  8. RocEDU.阅读.写作《苏菲的世界》书摘(四)

    亚理斯多德认为,快乐有三种形式.一种是过着享乐的生活,一种是做一个自由而负责的公民,另一种则是做一个思想家与哲学家.接着,他强调,人要同时达到这三个标准才能找到幸福与满足. 亚理斯多德提倡所谓的&qu ...

  9. Ubuntu 下安装Beyond Compare【转】

    本文转载自:https://blog.csdn.net/bingyu9875/article/details/52856675 官网下载安装包:http://www.scootersoftware.c ...

  10. 爬虫之动态HTML处理(Selenium与PhantomJS )网站模拟登录

    #coding=utf-8from selenium import webdriverfrom selenium.webdriver.common.keys import Keysimport tim ...