源码安装zabbix5.0

1. 安装依赖

先安装lnmp平台

准备zabbix源码包 zabbix-5.0.2.tar.gz

安装依赖

yum -y install net-snmp net-snmp-devel curl-devel java-1.8.0-openjdk
java-1.8.0-openjdk-devel OpenIPMI-devel libssh2-devel libevent-devel
2. 编译安装
groupadd -r zabbix && useradd -r -s /bin/false -g zabbix -M zabbix
cd /usr/local/src
tar zxf zabbix-5.0.2.tar.gz
cd zabbix-5.0.2.tar.gz
编译
./configure --prefix=/usr/local/zabbix --with-net-snmp --with-openipmi --with-zlib --enable-server --enable-agent --enable-javal/zabbix --with-mysql=/usr/local/mysql/bin/mysql_config --with-libxml2
安装
make && make install
设置属主
chown -R zabbix:zabbix /usr/local/zabbix
3.登录mysql创建库船舰用户

mysql> create database zabbix charset utf8 collate utf8_bin;
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> create user zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on zabbix.* to zabbix@localhost;

导入数据库文件

[root@zlnmp-10 zabbix-5.0.2]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@zlnmp-10 zabbix-5.0.2]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql 
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@zlnmp-10 zabbix-5.0.2]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql

环境变量

vim /etc/profile

ZABBIX_HOME=/usr/local/zabbix

export PATH=$ZABBIX_HOME/bin:$ZABBIX_HOME/sbin:$PATH

4. 查看zabbix_server的时候报错

ln -s /usr/local/mysql/lib/libmysqlclient.so.21 /usr/lib64

ln -s /usr/local/mysql/lib/private/libcrypto.so.1.1 /usr/lib64

ln -s /usr/local/mysql/lib/private/libssl.so.1.1 /usr/lib64

5.启动zabbix服务

zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf

6.复制前端页面到nginx的html目录下

cd /usr/local/src/zabbix-5.0.2/

cp -rf ui/ /usr/local/nginx/html/zabbix

源码安装zabbix5.0_第1张图片

源码安装zabbix5.0_第2张图片

 这些修改php.ini文件

vim /etc/php.ini

max_execution_time = 300
max_input_time = 300

date.timezone = Asia/shanghai

post_max_size = 16M

重启php

service php-fpm restart

少截一张图

有一个密码是数据库设置的密码 

 源码安装zabbix5.0_第3张图片

 默认的帐户密码 Admin    zabbix

设置启动脚本

cd /usr/local/src/zabbix-5.0.2/

cp ./misc/init.d/fedora/core5/zabbix_* /etc/init.d/

chkconfig --add /etc/init.d/zabbix_server

chkconfig --add /etc/init.d/zabbix_agentd

有地方需要修改一下

vim /etc/init.d/zabbix_server

ZABBIX_BIN="/usr/local/sbin/zabbix_server"改为

ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_server"

agent也需要修改

你可能感兴趣的:(linux,centos,服务器)