侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

Centos6.6安装zabbix server 3.2

2023-12-02 星期六 / 0 评论 / 0 点赞 / 91 阅读 / 4440 字

Centos6.6安装zabbix server 3.2mysql,php,tengine 安装包和表分区脚本下载:https://pan.baidu.com/s/1o80fF8A1.服务器信息ip:

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 = 16Mmax_execution_time = 300max_input_time = 300date.timezone = Asia/Shanghaialways_populate_raw_post_data = -1

重启php-fpm

# killall php-fpm && php-fpm

继续配置zabbix前端

###表分区

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

# sh showsql.sh

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

# sh add_partition.sh

广告 广告

评论区