centos7安装zabbix4.4.3

centos7安装zabbix4.4.3

一、安装zabbix

1.zabbix官网下载zabbix server源码包到本地
2.通过ftp将本地 (主机)源码包传输至centos7 ,本人存放在了/var/ftp/ 路径下
3.安装依赖

yum install wget telnet net-tools python-paramiko gcc gcc-c++ dejavu-sans-fonts python-setuptools python-devel sendmail mailx net-snmp net-snmp-devel net-snmp-utils freetype-devel libpng-devel perl unbound libtasn1-devel p11-kit-devel OpenIPMI unixODBC libevent-devel mysql-devel libxml2-devel libssh2-devel OpenIPMI-devel java-1.8.0-openjdk-devel openldap-devel curl-devel unixODBC-devel
  1. 解压并编译安装
tar -zxvf zabbix-4.4.3.tar.gz
cd zabbix-4.4.3/

5.建立编译安装目录

mkdir -p /data/zabbix./configure --prefix=/data/zabbix --enable-server --enable-agent --enable-java --with-mysql --with-libxml2 --with-unixodbc --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl --with-iconv
make
make install

6.查看安装版本

/data/zabbix/sbin/zabbix_server -V

二、数据库安装配置

1.yum安装数据库(也可先下载数据包)

yum install mariadb-server
systemctl start mariadb.service //开机自启动
systemctl status mariadb.service
mysql_secure_installation

2.创建数据库

   mysql -uroot -p
   create database zabbix character set utf8 collate utf8_bin;
   grant all privileges on zabbix.* to zabbix@localhost identified by '123456.';
   flush privileges;

3.导入数据结构

mysql -u zabbix -p 123456
use zabbix; //指定数据库
source /var/ftp/zabbix-4.4.3/database/mysql/schema.sql
source /var/ftp/zabbix-4.4.3/database/mysql/images.sql
source /var/ftp/zabbix-4.4.3/database/mysql/data.sql

导入数据连接:https://blog.csdn.net/it_male/article/details/81353984

4.修改zabbix server配置
a.编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password
5.增加用户

groupadd --system zabbix
useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix 		System" zabbix

6.启动服务

/data/zabbix/sbin/zabbix_server -c /data/zabbix/etc/zabbix_server.conf
/data/zabbix/sbin/zabbix_agentd -c /data/zabbix/etc/zabbix_agentd.conf
tailf /tmp/zabbix_server.log
tailf /tmp/zabbix_agentd.log
ps aux | grep zabbix

三、增加Zabbix镜像源

rpm -ivh http://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm

注:zabbix组件,因网速问题,可能需要多次执行
注:centos7本地库镜像源*

四、安装Zabbix Frontend

1、yum安装zabbix-web-mysql

	yum install zabbix-web-mysql

2、配置Zabbix frontend

vim /etc/php.ini
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_time = 300
max_input_vars = 10000
always_populate_raw_post_data = -1
date.timezone = Asia/Shanghai

3、启动httpd

systemctl start httpd.service
systemctl status httpd.service
cd /var/ftp/zabbix-4.4.3
cp misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix-server
cp misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix-agent
chmod +x /etc/rc.d/init.d/zabbix-server
chmod +x /etc/rc.d/init.d/zabbix-agent
chkconfig --add zabbix-server
chkconfig --add zabbix-agent
chkconfig zabbix-server on
chkconfig zabbix-agent on
vi /etc/rc.d/init.d/zabbix-agent 和zabbix-server

a.编辑客户端配置文件
BASEDIR=/data/zabbix/
b.zabbix安装目录
PIDFILE=/usr/local/zabbix/logs/$BINARY_NAME.pid #pid文件路径
(可以使用默认)
:wq! #保存退出
c、访问登录页面
http://127.0.0.1:80/zabbix/setup.php
Admin
zabbix

若页面报zabbix server is not running错误,首先确定server服务是否启动,然后查看SELinux是否开启着。

 setenforce 0

解决方法见:https://blog.csdn.net/fake_hydra/article/details/83061765

你可能感兴趣的:(centos7安装zabbix4.4.3)