安装zabbix5.0
1.下载源码包
wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.2.tar.gz
2.解压包
tar -xzvf zabbix-5.0.2.tar.gz
cd zabbix-5.0.2
3.解决依赖
yum -y install gcc gcc-c++ curl curl-devel net-snmp net-snmp-devel perl-DBI libxml2-devel libevent-devel pcre
4.创建用户
groupadd zabbix
useradd -g zabbix zabbix
usermod -s /sbin/nologin zabbix
5.创建数据库并导入初始化
systemctl start mariadb
mysql -uroot -p密码
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@localhost identified by '123456';
flush privileges;
解压zabbix软件包并将Zabbix基础SQL文件导入数据至Zabbix数据库:
mysql -uzabbix -p123456 zabbix <database/mysql/schema.sql
mysql -uzabbix -p123456 zabbix <database/mysql/images.sql
mysql -uzabbix -p123456 zabbix < database/mysql/data.sql
6.预编译、编译、安装
切换至Zabbix解压目录,执行如下代码,安装Zabbix_server:
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make&&make install
chown zabbix:zabbix /usr/local/zabbix/ -R
7,创建软连接,使系统能发zabbix*命令
ln -s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/
8,配置zabbix_server\zabbix_agentd启动脚本
cd zabbix-5.0.2
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix_agentd chmod o+x /etc/init.d/zabbix_agentd
cp misc/init.d/tru64/zabbix_server /etc/init.d/zabbix_server
chmod o+x /etc/init.d/zabbix_server
9.配置整合Apache和PHP
*#整合apache和php* cd zabbix-5.0.2 cp -a ui/* /var/www/html/ chown -R apache:apache /var/www/html/
10,修改配置Zabbix server配置文件
备份Zabbix server配置文件,代码如下:
cp zabbix_server.conf zabbix_server.conf.bak
修改zabbix_server.conf配置文件中代码设置为如下:
修改zabbix_server.conf配置文件中代码设置为如下:
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
11,重启
/etc/init.d/zabbix_server restart systemctl restart httpd systemctl restart mariadb
浏览器搜索ip
修改/etc/opt/remi/php73/php.ini文件对应的失败项如下
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai
重启
systemctl restart php-fpm
systemctl restart httpd
转载:https://blog.csdn.net/weixin_52184735/article/details/117368441
查看评论