Linux:zabbix-server安装

zabbix-server安装

zabbix是当前最火的开源监控软件之一,其他理论不说,下面搭建一个zabbix的server端。

server: 192.168.186.10

搭建LAMP环境

[root@zabbix-server ~]# yum -y install mariadb mariadb-server php-fpm httpd

升级zabbix软件仓库

[root@zabbix-server ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

打开zabbix-frontend源

[root@zabbix-server ~]# vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1   #改为1,表示打开
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

安装软件及各种组件

[root@zabbix-server ~]# yum -y install zabbix-server-mysql zabbix-agent mariadb-server
[root@zabbix-server ~]# yum -y install centos-release-scl
[root@zabbix-server ~]# yum -y install zabbix-web-mysql-scl zabbix-apache-conf-scl

配置数据库

[root@zabbix-server ~]# systemctl start mariadb
[root@zabbix-server ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> delete from mysql.user where user="";
Query OK, 2 rows affected (0.00 sec)

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

导入数据

[root@zabbix-server ~]# cd /usr/share/doc/zabbix-server-mysql-5.0.3/
[root@zabbix-server ~]# zcat create.sql.gz |mysql -uzabbix -p -D zabbix

修改配置文件

[root@zabbix-server ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
#可以根据自己的实际情况修改

配置PHP时区

[root@zabbix-server ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai 

启动服务

[root@zabbix-server ~]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm

在web界面进行安装

使用浏览器访问: 192.168.186.10/zabbix
按照指引进行安装即可。

登录

默认用户:Admin
默认密码:zabbix

zabbix-server部署完毕!

你可能感兴趣的:(Linux,zabbix,linux,zabbix)