YUM安装Zabbix-Server

  • Post author:
  • Post category:Zabbix
  • Page Views 450 阅读

1.软件下载

官网下载链接:https://www.zabbix.com/download

软件官方仓库:http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/

2.安装Zabbix-Server

[root@Zabbix ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@Zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y
[root@Zabbix ~]# yum install mariadb-server -y

3.修改my.cnf

/etc/my.cnf增加以下两个参数;此配置近满足小规模使用;如果中大型规模请参考:https://github.com/zabbix-book/MYSQL_conf提供的参数;

character-set-server=utf8
innodb_file_per_table=1
######################
[root@Zabbix ~]# systemctl start mariadb [root@Zabbix ~]# systemctl enable mariadb

4.创建数据库以及授权

[root@Zabbix ~]# mysqladmin -uroot password admin   #修改root密码
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; MariaDB [(none)]> flush privileges;

5.导入Zabbix库数据文件

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

6.修改配置文件

编辑文件/etc/zabbix/zabbix_server.conf
DBPassword=zabbix
编辑文件/etc/httpd/conf.d/zabbix.conf,取消注释并为设置正确的时区
php_value date.timezone Asia/Shanghai

7.防火墙开放端口

[root@Zabbix ~]# firewall-cmd --permanent --add-port=80/tcp
[root@Zabbix ~]# firewall-cmd --permanent --add-port=10050/tcp #agent被动端口
[root@Zabbix ~]# firewall-cmd --permanent --add-port=10051/tcp #agent主动端口
[root@Zabbix ~]# firewall-cmd --reload
[root@Zabbix ~]# setenforce 0

8.启动服务

[root@Zabbix ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@Zabbix ~]# systemctl enable zabbix-server zabbix-agent httpd

访问:http://IP/zabbix


「 文章如果对你有帮助,请点个赞哦^^ 」 

0