centos 安装cacti 笔记
2018-02-01 14:12
253 查看
yum -y install wget
service iptables stop 关闭防火墙setenforce 0 关闭selinux
1.安装epel 源$ yum install epel-release -y
2.安装依赖软件(lamp、net-snmp、rrdtool)yum install httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel wget httpd* mysql* libart_lgpl* net-snmp* libtool gcc gcc-c++ vim* cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp net-snmp-utils rrdtool -yyum install php-snmp net-snmp -yyum -y install php-process PHP-ldapyum search ldapyum install PHP-ldap
3.启动相关服务$ /etc/init.d/mysqld start$ /etc/init.d/httpd start$ /etc/init.d/snmpd startchkconfig --level 2345 snmpd on 设置snmp启动项chkconfig --level 2345 httpd on 设置http启动项chkconfig --level 2345 mysqld on 设置mysql启动项
Apache:$ vim /etc/httpd/conf/httpd.conf# 增加下行,避免启动httpd服务出现关于ServerName的警告。ServerName 自定义:80
$ vim /etc/httpd/conf.d/cacti.conf # 原配置文件内容如下: # <Directory /usr/share/cacti/> <IfModule mod_authz_core.c> # httpd 2.4 Require host localhost </IfModule> <IfModule !mod_authz_core.c> # httpd 2.2 Order deny,allow Deny from all Allow from all </IfModule> </Directory> # # yum安装的httpd为2.2版本,在httpd-2.2配置段的"Allow from localhost"后添加允许访问的主机IP, # 或者直接改为"Allow from all"以允许所有IP访问。 # 这样才能进行Cacti的Web端安装和监控。$ /etc/init.d/httpd restart
PHP:$ vim /etc/php.ini# 设置时区date.timezone = Asia/Shanghai
wget https://www.cacti.net/downloads/cacti-1.1.36.tar.gztar zxvf cacti-1.1.36.tar.gzmv cacti-1.1.36/* /var/www/html/cacti
wget https://www.cacti.net/downloads/spine/cacti-spine-1.1.36.tar.gztar zxvf cacti-spine-1.1.36.tar.gzcd cacti-spine-1.1.36./configure && make && make install
Mysql:$ mysql -urootmysql> create database cacti;mysql> grant all on cacti.* to cacti@localhost identified by 'cactipassword';mysql> flush privileges;grant all privileges on *.* to cacti@localhost identified by 'cactipassword';flush privileges;
mysql> quit$ mysql -uroot cacti < /var/www/html/cacti/cacti.sqlmysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysqlmysql初始没有密码,进入mysql,创建cacti数据库,赋予cacti用户对该数据库进行操作的权限,导入
vim /var/www/html/cacti/include/config.php
$database_type = 'mysql';$database_default = 'cacti';$database_hostname = 'localhost';$database_username = 'cacti';$database_password = 'cactipassword';$database_port = '3306';$database_ssl = false;
/etc/init.d/httpd restart/usr/bin/php /var/www/html/cacti/poller.php
$ /usr/bin/php /usr/share/cacti/poller.php $ crontab -e# 写入下行,每五分钟获取监控信息 */5 * * * * /usr/bin/php /usr/share/cacti/poller.php
service iptables stop 关闭防火墙setenforce 0 关闭selinux
1.安装epel 源$ yum install epel-release -y
2.安装依赖软件(lamp、net-snmp、rrdtool)yum install httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel wget httpd* mysql* libart_lgpl* net-snmp* libtool gcc gcc-c++ vim* cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel net-snmp net-snmp-utils rrdtool -yyum install php-snmp net-snmp -yyum -y install php-process PHP-ldapyum search ldapyum install PHP-ldap
3.启动相关服务$ /etc/init.d/mysqld start$ /etc/init.d/httpd start$ /etc/init.d/snmpd startchkconfig --level 2345 snmpd on 设置snmp启动项chkconfig --level 2345 httpd on 设置http启动项chkconfig --level 2345 mysqld on 设置mysql启动项
Apache:$ vim /etc/httpd/conf/httpd.conf# 增加下行,避免启动httpd服务出现关于ServerName的警告。ServerName 自定义:80
$ vim /etc/httpd/conf.d/cacti.conf # 原配置文件内容如下: # <Directory /usr/share/cacti/> <IfModule mod_authz_core.c> # httpd 2.4 Require host localhost </IfModule> <IfModule !mod_authz_core.c> # httpd 2.2 Order deny,allow Deny from all Allow from all </IfModule> </Directory> # # yum安装的httpd为2.2版本,在httpd-2.2配置段的"Allow from localhost"后添加允许访问的主机IP, # 或者直接改为"Allow from all"以允许所有IP访问。 # 这样才能进行Cacti的Web端安装和监控。$ /etc/init.d/httpd restart
PHP:$ vim /etc/php.ini# 设置时区date.timezone = Asia/Shanghai
wget https://www.cacti.net/downloads/cacti-1.1.36.tar.gztar zxvf cacti-1.1.36.tar.gzmv cacti-1.1.36/* /var/www/html/cacti
wget https://www.cacti.net/downloads/spine/cacti-spine-1.1.36.tar.gztar zxvf cacti-spine-1.1.36.tar.gzcd cacti-spine-1.1.36./configure && make && make install
Mysql:$ mysql -urootmysql> create database cacti;mysql> grant all on cacti.* to cacti@localhost identified by 'cactipassword';mysql> flush privileges;grant all privileges on *.* to cacti@localhost identified by 'cactipassword';flush privileges;
mysql> quit$ mysql -uroot cacti < /var/www/html/cacti/cacti.sqlmysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysqlmysql初始没有密码,进入mysql,创建cacti数据库,赋予cacti用户对该数据库进行操作的权限,导入
vim /var/www/html/cacti/include/config.php
$database_type = 'mysql';$database_default = 'cacti';$database_hostname = 'localhost';$database_username = 'cacti';$database_password = 'cactipassword';$database_port = '3306';$database_ssl = false;
/etc/init.d/httpd restart/usr/bin/php /var/www/html/cacti/poller.php
$ /usr/bin/php /usr/share/cacti/poller.php $ crontab -e# 写入下行,每五分钟获取监控信息 */5 * * * * /usr/bin/php /usr/share/cacti/poller.php
相关文章推荐
- CentOS7 下安装 Cacti0.8.8h 笔记
- Centos6.5 LAMP环境源码包安装与配置,附安装包百度网盘地址 (转做笔记)
- CentOS7 编译安装LVS 互为主备 (实测 笔记 Centos 7.0 + ipvsadm 1.27 + keepalived 1.2.15 )
- Centos 6.2 安装Mysql笔记
- CentOS 7运维管理笔记(4)----安装ftp服务器
- CentOS6.5在VMware的安装笔记
- CentOS5.4(64bit)下安装配置Cacti----SNMP+RRDTool安装配置(RPM安装)
- centos5.5下cacti安装部署步骤
- Centos学习笔记--安装
- VM12.5安装CentOS-7 64位 笔记
- centos 6.5下安装mysql+nginx+redmine 3.1.0 笔记
- Centos-6.3-x86_64 minimal 迷你版安装笔记 - Resin篇
- CentOS 6.3下安装PHP xcache扩展模块笔记
- CentOS 5.4 x86_64 编译安装 MySQL 完全笔记
- CentOS 6.5安装配置Cacti
- centos7.4源码安装cacti仙人掌1.1.26版本
- CentOS下 MySQL 5.5.13 CMake 安装笔记
- 慕课linux学习笔记(一)centOS的安装
- 监控工具之CACTI的安装和应用(centos7)
- centos5.5中安装drbd笔记