标签:自动化运维 zabbix3.0搭建
[root@zabbix ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@zabbix ~]# uname -r
2.6.32-696.el6.x86_64
[root@zabbix ~]# uname -m
x86_64
[root@zabbix ~]# /etc/init.d/iptables stop
[root@zabbix ~]# setenforce 0
[root@zabbix ~]# sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/sysconfig/selinux
在安装zabbix3.0以上版本时,php的版本需要大于5.4以上的版本
MySQL: MySQL 5.6.40
php: PHP 5.6.35
Apache: httpd-2.2.15
zabbix: 3.2.11
[root@zabbix ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
[root@zabbix ~]# yum install -y httpd libxml2-devel net-snmp-devel libcurl-devel php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
[root@zabbix ~]# rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
[root@zabbix ~]# yum -y install mysql-server
[root@zabbix ~]# wget http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-
1.el6.noarch.rpm
[root@zabbix ~]# rpm -ivh zabbix-release-3.2-1.el6.noarch.rpm
[root@zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
[root@zabbix ~]# mysqladmin -uroot password “123456”
[root@zabbix ~]# mysql -uroot -p123456
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
mysql>quit;
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql-3.2.11/create.sql.gz |mysql -uroot -p123456 zabbix
[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
[root@zabbix ~]# vim /etc/php.ini
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=-1
[root@zabbix ~]# sed -i 's#Server=127.0.0.1#Server=61.163.231.195#'
/etc/zabbix/zabbix_agentd.conf
[root@zabbix ~]# cp -r /usr/share/zabbix/* /var/www/html/zabbix/
[root@zabbix ~]# chown -R apache:apache /var/www/html/zabbix
[root@zabbix ~]# /etc/init.d/httpd start
[root@zabbix ~]# /etc/init.d/mysqld start
[root@zabbix ~]# /etc/init.d/ zabbix-agent start
[root@zabbix ~]# /etc/init.d/ zabbix-server start
[root@zabbix ~]# echo “/etc/init.d/httpd start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/mysqld start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/zabbix-agent start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/zabbix-server start” >>/etc/rc.local
输入ip+zabbix
默认的登录用户名:Admin
默认的登录密码:zabbix
Zabbix: zabbix-3.2.11.tar.gz
MySQL: MySQL 5.1.73
php: PHP 5.6.35
Apache: httpd-2.2.15
[root@zabbix ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
[root@zabbix ~]# yum -y install httpd httpd-devel mysql mysql-server mysql-devel
[root@zabbix ~]# yum install php56w php56w-mysql php56w-common php56w-gd php56w-mbstring php56w-mcrypt php56w-devel php56w-xml php56w-bcmath -y
[root@zabbix ~]# yum install -y gcc-c++ net-snmp net-snmp-devel curl curl-devel libxml2
libxml2-devel
[root@zabbix ~]# mkdir -p /application/tools
[root@zabbix ~]# cd /application/tools
[root@zabbix ~]# rz
[root@zabbix ~]# tar xf zabbix-3.2.11.tar.gz
[root@zabbix ~]# cd zabbix-3.2.11
[root@zabbix ~]# ./configure --prefix=/application/zabbix-3.2.11 --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
[root@zabbix ~]# make && make install
[root@zabbix ~]# ln -s /application/zabbix-3.2.11 /application/zabbix
[root@zabbix ~]# mysqladmin -uroot password “123456”
[root@zabbix ~]# mysql -uroot -p123456
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
mysql>quit;
[root@zabbix ~]# cd /application/tools/zabbix-3.0.17/database/mysql/
[root@zabbix mysql]# mysql -uroot -p123456 zabbix <schema.sql
[root@zabbix mysql]# mysql -uroot -p123456 zabbix <images.sql
[root@zabbix mysql]# mysql -uroot -p123456 zabbix <data.sql
[root@zabbix ~]# mkdir -p /var/www/html/zabbix
[root@zabbix ~]# cp –rf /usr/local/src/zabbix-3.2.2/frontends/php/* /var/www/html/zabbix/
[root@zabbix ~]# vim /etc/php.ini
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=-1
[root@zabbix ~]# vim /application/zabbix/etc/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
[root@zabbix ~]# vim /application/zabbix/etc/agent_server.conf
Server=127.0.0.1
Hostname=Zabbix server
[root@zabbix ~]# cd /usr/local/src/zabbix-3.2.2/misc/
[root@zabbix ~]# cp init.d/tru64/zabbix_server /etc/init.d/
[root@zabbix ~]# cp init.d/tru64/zabbix_agentd /etc/init.d/
[root@zabbix ~]# chmod +x /etc/init.d/zabbix_*
[root@zabbix ~]# sed -i 's#/usr/local#/application/zabbix#g' /etc/init.d/zabbix_server
[root@zabbix ~]# sed -i 's#/usr/local#/application/zabbix#g' /etc/init.d/zabbix_agentd
[root@zabbix ~]# /etc/init.d/mysqld start
[root@zabbix ~]# /etc/init.d/httpd restart
[root@zabbix ~]# /etc/init.d/zabbix_server start
[root@zabbix ~]# /etc/init.d/zabbix_agentd start
[root@zabbix ~]# echo “/etc/init.d/httpd start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/mysqld start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/zabbix-agent start” >>/etc/rc.local
[root@zabbix ~]# echo “/etc/init.d/zabbix-server start” >>/etc/rc.local
输入ip+zabbix
默认的登录用户名:Admin
默认的登录密码:zabbix
标签:自动化运维 zabbix3.0搭建
原文地址:http://blog.51cto.com/lzhnb/2118294