欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > centos >内容正文

centos

Centos6.6安装zabbix server 3.2

发布时间:2025/7/14 centos 80 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Centos6.6安装zabbix server 3.2 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

2019独角兽企业重金招聘Python工程师标准>>>

Centos6.6安装zabbix server 3.2

mysql,php,tengine 安装包和表分区脚本下载:https://pan.baidu.com/s/1o80fF8A

1.服务器信息

ip:192.168.106.149

关闭selinux,iptables

# setenforce 0

# service iptables stop && chkconfig iptables off

安装epel源

# yum install epel-release -y

安装依赖包

# yum install mysql-devel libcurl-devel libxml2-devel net-snmp-devel java-1.8.0-openjdk java-1.8.0-openjdk-devel -y

修改时区

# \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2. 安装zabix server 3.2.3

下载并编译安装 zabbix server 3.2.3

# mkdir -p /data/packages && cd /data/packages && wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.3/zabbix-3.2.3.tar.gz && tar xzvf zabbix-3.2.3.tar.gz && cd zabbix-3.2.3

# ./configure --prefix=/data/app/zabbix3.2.3/ --with-mysql --enable-server --enable-agent --enable-java --with-net-snmp --with-libcurl --with-libxml2

# make install

# cp misc/init.d/fedora/core5/zabbix_server /etc/init.d/

# chmod 755 /etc/init.d/zabbix_server

# sed -i 's/\/usr\/local\/sbin\/zabbix_server/\/data\/app\/zabbix3.2.3\/sbin\/zabbix_server/' /etc/init.d/zabbix_server

添加zabbix用户

# useradd -s /sbin/nologin zabbix

修改zabbix server配置文件

# vi /data/app/zabbix3.2.3/etc/zabbix_server.conf

略,请执行调整修改

启动zabbix server

# service zabbix_server start

查看zabbix server状态

# service zabbix_server status

zabbix_server (pid 82433 82432 82431 82430 82425 82424 82423 82422 82418 82417 82416 82415 82414 82411 82410 82409 82408 82407 82406 82405 82404 82403 82402 82401 82400 82399 82398 82396) is running...

安装mysql 5.6

# tar xzvf mysql-5.6_install_scripts.tar.gz && cd mysql-5.6

# sh install.sh

# mysql -e "create database zabbix"

# mysql -e "grant all privileges on *.* to zabbix@'%' identified by 'zabbixpassword';"

依次导入结构和数据

# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/schema.sql

# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/images.sql

# mysql zabbix < /data/packages/zabbix-3.2.3/database/mysql/data.sql

修改root密码

# mysql mysql -e "update user set password=password('password') where user='root';flush privileges;"

安装前端

# cp -a /data/packages/zabbix-3.2.3/frontends/php /data/app/zabbix3.2.3/

上传tengine和php安装包,不要使用yum安装,yum安装php版本过低,不受支持

# tar xzvf php.tar.gz

# tar xzvf tengine-2.1.tar.gz

# cd php-5.6.10/ && sh install-php-5.6.10.sh

# cd .. && tar xzvf tengine-2.1.tar.gz && install.sh

# ldconfig

# cd /data/app/tengine/conf/vhost/

配置nginx站点,注意根据访问的域名修改server_name

# vi zabbix.conf

server{listen 80;server_name 192.168.106.149;access_log /data/app/tengine/logs/zabbix.access;error_log /data/app/tengine/logs/zabbix.error error;location ~ .php$ {root /data/app/zabbix3.2.3/php;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}location / {root /data/app/zabbix3.2.3/php;index index.php;} }

启动php-fpm

# php-fpm

启动nginx

# nginx -t && nginx

访问http://192.168.106.149/安装前端 发现报了一堆php参数错误

修改php.ini中如下参数

# vi /data/app/php/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

重启php-fpm

# killall php-fpm && php-fpm

继续配置zabbix前端

###表分区

执行脚本生成创建表分区sql

# sh showsql.sh

crontab脚本每天自动去创建分区

# sh add_partition.sh

转载于:https://my.oschina.net/u/1791060/blog/814077

总结

以上是生活随笔为你收集整理的Centos6.6安装zabbix server 3.2的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。