CentOS7下安装搭建Cacti

1.搭建lamp环境

配置apache

[[email protected] ~]# yum -y install httpd

[[email protected] ~]# systemctl start httpd

[[email protected] ~]# systemctl enable httpd

[[email protected] ~]# firewall-cmd --permanent --add-service=http

success

[[email protected] ~]# firewall-cmd --reload

success

配置mariadb

[[email protected] ~]# yum -y install mariadb-server mysql-devel

[[email protected] ~]# systemctl start mariadb

[[email protected] ~]# 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

[[email protected] ~]# mysql -u root -p

MariaDB [(none)]> grant all privileges on *.* to [email protected] identified by ‘RedHat‘; 创建用于测试php和mariadb连通性的用户

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;

[[email protected] ~]# systemctl restart mariadb

[[email protected] ~]# systemctl enable mariadb

[[email protected] ~]# firewall-cmd --permanent --add-port=3306/tcp

success

[[email protected] ~]# firewall-cmd --reload

success

配置php

[[email protected] ~]# yum -y install php php-mysql php-gd php-pear

[[email protected] ~]# vim /etc/php.ini

date.timezone =PRC      修改时区

[[email protected] ~]# 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()

?>

[[email protected] ~]# systemctl restart httpd

测试

2.安装配置cacti

下载软件

[[email protected] ~]# cd /usr/local/src/

[[email protected] src]# wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz

[[email protected] src]# tar zxvf cacti-0.8.8f.tar.gz

[[email protected] src]# mv cacti-0.8.8f /var/www/html/cacti

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

[[email protected] ~]# mysql -u root -p

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

MariaDB [(none)]> grant all privileges on cacti.* to [email protected] identified by ‘redhat‘;

MariaDB [(none)]> flush privileges;

把cacti.sql导入数据库

[[email protected] cacti]# mysql -ucacti -predhat cacti < /var/www/html/cacti/cacti.sql

编辑config.php和global.php

[[email protected] 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以生成图像

[[email protected] src]# yum -y install rrdtool rrdtool-devel rrdtool-php rrdtool-perl

[[email protected] src]# yum -y install gd gd-devel php-gd    ---rrdtool绘制图像需要的图形库

安装snmp服务

[[email protected] cacti]# yum -y install net-snmp net-snmp-utils php-snmp net-snmp-libs

编辑配置文件

[[email protected] ~]# 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

[[email protected] ~]# systemctl restart snmpd.service

[[email protected] ~]# systemctl enable snmpd.service

授权目录权限

[[email protected] ~]# useradd -r -M cacti

[[email protected] ~]# chown -R cacti /var/www/html/cacti/rra/

[[email protected] ~]# chown -R cacti /var/www/html/cacti/log/

配置一个抓图的计划任务

[[email protected] ~]# crontab -e

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

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

报错

MySQL TimeZone Support ERROR: Your Cacti database login account does not have access to the MySQL TimeZone database. Please provide the Cacti database account "select" access to the "time_zone_name" table in the "mysql" database, and populate MySQL‘s TimeZone information before proceeding

**bash环境下执行 mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

mysql环境下

mysql> use mysql;

mysql> GRANT SELECT ON mysql.time_zone_name TO [email protected];

mysql> flush privileges;**

时间: 2024-10-11 12:51:43

CentOS7下安装搭建Cacti的相关文章

Centos7下安装及配置Zabbix3.0

说到Zabbix相信很多管理员都使用过,因为zabbix所提供的功能给广大管理员们及时得知自己所管理的服务器的服务状态,当然有很多软件服务(cacti.ngios等)都可以实现zabbix类似的功能,但是对于zabbix的功能相对更强大一点,具体就不细说了,今天我们主要介绍一下,Centos7下安装及配置Zabbix3.0的介绍,具体见下: 在安装服务器的时候我们需要注意一些问题:比如服务器的防火墙.selinux等都会影响到Zabbix的正常通信 环境介绍: OS:Centos7 Servic

centos7下安装Jdk8、Tomcat8小计

申请到一台 三 丰 云 免 费 主 机,安装centos操作系统,记录一下centos7下安装Jdk8.Tomcat8的操作 一.JDK1.8 环境搭建 1.上传文件解压 [[email protected] mysoft]# tar -zxvf jdk-8u161-linux-x64.tar.gz[[email protected] mysoft]# pwd/usr/local/mysoft[[email protected] mysoft]# mv jdk1.8.0_161 jdk1.8 2

Linux下安装搭建Memcached集群环境

Linux下安装搭建Memcached集群环境

Centos7下安装及配置PPTP VPN

说到VPN服务,我们大家都知道,VPN是虚拟专用网络(Virtual Private Network)的缩写,VPN有多种分类方式,包括PPTP.L2TP.IPSec等,本文配置的VPN服务器是采用PPTP协议的,PPTP是在PPP协议基础上开发的一种新的增强型安全协议.当然在windows上和linux上都可以部署服务,我们今天主要介绍一下在Centos7下安装及配置PPTP VPN. 因为PPTP是基于PPP协议基础上的,因此需要系统支持PPP,使用 rpm -qa ppp 检查是否安装了P

CentOS-7下安装MySQL5.6.22

CentOS7下安装MySQL5.6.22(当前最新版本:2015-01-17) 转载请注明出处:jiq?钦's technical Blog 一  安装环境 (1)CentOS版本:CentOS-7 查看方法: [[email protected] 桌面]# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core) 来源:官网下载 下载地址:http://www.centos.org/ (2)MySQL版本:MySQL-5.6.2

centos7下安装mariadb

参考: http://www.cnblogs.com/Netsharp/p/5875474.html https://downloads.mariadb.org/mariadb/repositories/#mirror=neusoft&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.1 RDS for MySQL 备份文件恢复到自建数据库 参考: https://help.aliyun.com/knowl

CentOS7下安装MySQL并配置远程连接

一.CentOS7下安装MySQL数据库 CentOS7默认的安装包里面已经没有 MySQL-Server安装包了,远程镜像中也没有了. 默认的是MariaDB (MySQL的一个分支,开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险 参照百度.开发基本相似). 参考文章:CentOS7 安装MySQL http://www.centoscn.com/mysql/2016/0315/6844.html 这里主要是安装MyS

(转)LINUX CENTOS7下安装PYTHON

LINUX CENTOS7下安装PYTHON 原文:http://www.cnblogs.com/lclq/p/5620196.html Posted on 2016-06-27 14:58 南宫羽香 阅读(8506) 评论(5) 编辑 收藏 1.查看是否已经安装Python Centos7默认安装了python2.7.5 因为一些命令要用它比如yum 它使用的是python2.7.5. 使用python -V命令查看一下是否安装Python: 然后查看一下Python可执行文件的位置: 进入到

CentOS7 下 安装 supervisor以及使用

CentOS7 下 安装 supervisor 以及使用 手动安装 [注] linux环境必须安装 python 1.获取supervisor包:[https://pypi.python.org/pypi/supervisor] # wget https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/supervisor-3.3.1.tar.gz 2.解压