CentOS 编译安装 zabbix 3
来源:互联网 发布:豆瓣python 编辑:程序博客网 时间:2024/06/08 16:11
一、依赖安装
环境:
系统环境:CentOS:7.2
zabbix版本:3.4.2
- 安装依赖包
yum -y install mariadb mariadb-server php php-fpm php-cli php-common php-mcrypt php-pdo php-mysql mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp net-snmp-devel curl-devel OpenIPMI-devel gcc gcc-c++ autoconf libevent-devel libxml2-devel
- PHP 版本问题
一定要注意:zabbix要求php版本必须是5.4以上,centos 7 php版本符合条件,centos 6需要升级PHP版本
[root@localhost install]# php -vPHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02)
- 配置php参数
sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/" /etc/php.ini sed -i "s/max_execution_time = 30/max_execution_time = 300/" /etc/php.ini sed -i "s/post_max_size = 8M/post_max_size = 32M/" /etc/php.inised -i "s/max_input_time = 60/max_input_time = 300/" /etc/php.ini
- 启动php-fpm
systemctl restart php-fpm.servicesystemctl enable php-fpm.service
二、编译安装Nginx
zabbix官网下载地址:https://www.zabbix.com/download
nginx 官网下载地址:http://nginx.org/en/download.html
wget https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.2/zabbix-3.4.2.tar.gzwget http://nginx.org/download/nginx-1.12.1.tar.gz
- 编译安装Nginx
tar zxvf nginx-1.12.1.tar.gzcd nginx-1.12.1./configure --prefix=/data/server/nginxmake -j32 && make install
- 添加Nginx配置文件
vim /data/server/nginx/conf/nginx.conf
user apache;http { ...... include vhosts/*.conf; ......}
创建vhosts目录,vim /data/server/nginx/conf/vhosts/zabbix.conf
server{ listen 8080; root /data/www/zabbix; location / { try_files $uri $uri/ /index.php?$args; } location ~ ^(.+.php)(.*)$ { fastcgi_split_path_info ^(.+.php)(.*)$; include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_path_info; } location ~* ^.+\.(ico|gif|jpg|jpeg|png|html|css|htm|bmp|js|svg)$ { root /data/www/zabbix; }}
启动Nginx
/data/server/nginx/sbin/nginx -t # 配置检查/data/server/nginx/sbin/nginx
三、配置数据库,配置zabbix
- 设置mysql密码
systemctl restart mariadb.servicemysqladmin -uroot password 'mysql_pass' # -p123456 -p指定原密码
- 创建zabbix数据库并设置权限
mysql -uroot -pmysql_pass -e "create database zabbix character set utf8;"mysql -uroot -pmysql_pass -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"mysql -uroot -pmysql_pass -e "flush privileges;"
- 导入zabbix数据库
tar zxvf zabbix-3.4.2.tar.gzcd zabbix-3.4.2/database/mysql/mysql -uzabbix -pzabbix zabbix < schema.sql mysql -uzabbix -pzabbix zabbix < images.sql mysql -uzabbix -pzabbix zabbix < data.sql
- 配置mysql开机启动
systemctl enable mariadb.service
- 复制zabbix站点文件
cp -rp zabbix-3.4.2/frontends/php/ /data/www/zabbixchown -R apache.apache /data/www/zabbix/
- 编译安装zabbix
./configure --prefix=/data/server/zabbix --sysconfdir=/etc/zabbix --enable-server --enable-agent --with-openipmi --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 --enable-ipv6 --with-opensslmake -j32 && make installvim /etc/zabbix/zabbix_server.conf # 确认连接数据库账户密码LogFile=/tmp/zabbix_server.log # 日志路径,38行DBPassword=zabbix # 119行# 启动zabbix server/data/server/zabbix/sbin/zabbix_server
四、页面配置zabbix**
地址:http://192.168.19.129:8080/setup.php
zabbix web页面 默认用户名及密码
用户名:Admin 密码:zabbix
zabbix web问题:点击下一步没反应
无法点击下一步。可能由于nginx用户和php-fpm用户不一致,修改php-fpm配置,使之一致
[root@localhost ~]# grep "user = " /etc/php-fpm.d/www.confuser = apache[root@localhost ~]# grep "user .*;" /data/server/nginx/conf/nginx.confuser apache;
五、安装zabbix_agent
yum -y install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpmyum -y install zabbix-agent
阅读全文
0 0
- CentOS 编译安装 zabbix 3
- centos 7编译安装部署zabbix-server端
- Centos安装Zabbix
- CENTOS安装部署zabbix
- centos 安装 zabbix 小记
- centos 7 安装zabbix
- 源码编译安装zabbix
- zabbix 编译安装
- zabbix编译安装
- CentOS 安装zabbix-server和zabbix-agent
- centos zabbix 1.8.1 安装
- centos zabbix 1.8.1 安装
- Centos 6.5 安装 zabbix 2.4
- CentOS 6.7 安装zabbix-agent
- CentOS 7 yum安装Zabbix
- CentOS 7源码安装zabbix
- CentOS 6.5 最小化安装zabbix
- CentOS 7 yum安装Zabbix
- Python进阶(二):String类
- Zookeeper之Eclipse插件安装-yellowcong
- node中的module.exports、exports VS es6中的import、export
- JavaScript案例——网页特效之旋转
- ST17H26调试板操作注意事项
- CentOS 编译安装 zabbix 3
- 自定义RecyclerView之上拉刷新更新数据
- DoTween
- 如何生成 RDF 数据?
- oracle RAC如何正确地删除ASM磁盘组
- 偶串
- 动画
- HDOJ 1013 Digital Roots
- 双非渣硕的算法求职路