Zabbix监控服务器部署

闲话不说,直接部署,仅供参考!

云服务器一台做演示-系统版本:

 cat /etc/redhat-release    CentOS Linux release 7.5.1804 (Core)

1.安装zabbix官方yum源;repo.zabbix.yum (根据系统版本选择相应的zabbix版本下载)

root@iZ882mt6umfZ yum.repos.d]# rpm -ivh http://repo.zabbix.com/zabbix/4.3/rhel/7/x86_64/zabbix-release-4.3-3.el7.noarch.rpm

Retrieving http://repo.zabbix.com/zabbix/4.3/rhel/7/x86_64/zabbix-release-4.3-3.el7.noarch.rpm

warning: /var/tmp/rpm-tmp.EdkaeS: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

  1:zabbix-release-4.3-3.el7        ################################# [100%]

2.安装Mysql数据库

参考我上一篇文章,这里就不重复写了。https://www.jianshu.com/writer#/notebooks/34460583/notes/42193411

2.1 创建zabbix数据库/zabbix用户并授权

MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8;

Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix2020';

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>

2.2 zabbix server 端数据库连接安装

yum install zabbix-server-mysql

2.3 配置zabbix的server端数据连接

root@iZ882mt6umfZ ~]# cd /etc/zabbix/

[root@iZ882mt6umfZ zabbix]# cp zabbix_server.conf zabbix_server.conf.bak

[root@iZ882mt6umfZ zabbix]# vim zabbix_server.conf

根据自己实际设置修改相关参数-仅供参考

ListenPort=10051

DBHost=127.0.0.1

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix2020

DBSocket=/var/lib/mysql/mysql.sock

DBPort=3306

2.4 导入zabbix自带数据库

zcat /usr/share/doc/zabbix-server-mysql-4.2.6/create.sql.gz | mysql -uzabbix -pzabbix2020 zabbix

2.5 安装zabbix agent端以及相关组件的安装

yum install zabbix-agent zabbix-sender zabbix-get

3 安装Web环境与zabbix的web端

3.1安装php YUM源

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

3.2 安装zabbix需要的web环境

yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64  php56w-mysql.x86_64 php56w-pdo.x86_64

修改PHP的配置文件 

cd /etc/

cp php.ini php.ini.bak

vim php.ini (查找并修改相关参数)

date.timezone = Asia/Shanghai

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

always_populate_raw_post_data = -1

3.3 安装zabbix的web端

yuminstall zabbix-web zabbix-web-mysql

3.4 配置zabbix的web访问并启动

cp -R /usr/share/zabbix /var/www/html/

chown apache:apache -R /var/www/html/zabbix

service httpd restart

service zabbix-server start

访问 服务器地址 http://10.247.33.222/zabbix

Next step 一直点


默认用户名:admin  密码:zabbix


你可能感兴趣的:(Zabbix监控服务器部署)