CentOS 7.x安装搭建Zabbix3.0环境

文章目录

[隐藏]

  • 1、安装数据库mariadb
  • 2、下载(Choose your platform for Zabbix server)
  • 3、Install and configure Zabbix server
  • 4、Configure Zabbix frontend
1、安装数据库mariadb
[[email protected] ~]# yum install -y mariadb mariadb-server  [[email protected] ~]# systemctl start mariadb  [[email protected] ~]# systemctl enable mariadb  
[[email protected] ~]# vi /etc/my.cnf  [[email protected] ~]# cat /etc/my.cnf  [mysqld]  character-set-server=utf8  datadir=/var/lib/mysql  socket=/var/lib/mysql/mysql.sock  # Disabling symbolic-links is recommended to prevent assorted security risks  symbolic-links=0  # Settings user and group are ignored when systemd is used.  # If you need to run mysqld under a different user or group,  # customize your systemd unit file for mariadb according to the  # instructions in http://fedoraproject.org/wiki/Systemd  [mysqld_safe]  log-error=/var/log/mariadb/mariadb.log  pid-file=/var/run/mariadb/mariadb.pid  #  # include all files from the config directory  #  !includedir /etc/my.cnf.d    [client]  default-character-set=utf8  [mysql]  default-character-set=utf8  [[email protected] ~]#  
2、下载(Choose your platform for Zabbix server)

https://www.zabbix.com/

3、Install and configure Zabbix server

(1)Install Repository with MySQL database

[[email protected] ~]# rpm -i http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm  warning: /var/tmp/rpm-tmp.IcrMTU: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY  

(2)Install Zabbix server, frontend, agent

[[email protected] ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent  ...  Installed:    zabbix-agent.x86_64 0:3.0.16-1.el7          zabbix-server-mysql.x86_64 0:3.0.16-1.el7          zabbix-web-mysql.noarch 0:3.0.16-1.el7    Dependency Installed:    OpenIPMI-libs.x86_64 0:2.0.19-15.el7         OpenIPMI-modalias.x86_64 0:2.0.19-15.el7        apr.x86_64 0:1.4.8-3.el7_4.1    apr-util.x86_64 0:1.5.2-6.el7                dejavu-fonts-common.noarch 0:2.33-6.el7         dejavu-sans-fonts.noarch 0:2.33-6.el7    fping.x86_64 0:3.10-4.el7                    httpd.x86_64 0:2.4.6-67.el7.centos.6            httpd-tools.x86_64 0:2.4.6-67.el7.centos.6    iksemel.x86_64 0:1.4-6.el7                   libXpm.x86_64 0:3.5.12-1.el7                    libtool-ltdl.x86_64 0:2.4.2-22.el7_3    libxslt.x86_64 0:1.1.28-5.el7                libzip.x86_64 0:0.10.1-8.el7                    mailcap.noarch 0:2.1.41-2.el7    mariadb-libs.x86_64 1:5.5.56-2.el7           net-snmp-libs.x86_64 1:5.7.2-28.el7_4.1         php.x86_64 0:5.4.16-43.el7_4.1    php-bcmath.x86_64 0:5.4.16-43.el7_4.1        php-cli.x86_64 0:5.4.16-43.el7_4.1              php-common.x86_64 0:5.4.16-43.el7_4.1    php-gd.x86_64 0:5.4.16-43.el7_4.1            php-ldap.x86_64 0:5.4.16-43.el7_4.1             php-mbstring.x86_64 0:5.4.16-43.el7_4.1    php-mysql.x86_64 0:5.4.16-43.el7_4.1         php-pdo.x86_64 0:5.4.16-43.el7_4.1              php-xml.x86_64 0:5.4.16-43.el7_4.1    t1lib.x86_64 0:5.1.2-14.el7                  unixODBC.x86_64 0:2.3.1-11.el7                  zabbix-web.noarch 0:3.0.16-1.el7    Complete!  [[email protected] ~]#  

(3)Create initial database

[[email protected] ~]# 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.56-MariaDB MariaDB Server    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.    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 [email protected] identified by 'zabbix';  Query OK, 0 rows affected (0.00 sec)    MariaDB [(none)]> flush privileges;  Query OK, 0 rows affected (0.00 sec)    MariaDB [(none)]> quit  Bye  [[email protected] ~]#  

Import initial schema and data. You will be prompted to enter your newly created password.

[[email protected] ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix  Enter password:  [[email protected] ~]# mysql -uzabbix -pzabbix  Welcome to the MariaDB monitor.  Commands end with ; or g.  Your MariaDB connection id is 6  Server version: 5.5.56-MariaDB MariaDB Server    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.    MariaDB [(none)]> show databases;  +--------------------+  | Database           |  +--------------------+  | information_schema |  | zabbix             |  +--------------------+  2 rows in set (0.01 sec)    MariaDB [(none)]> use zabbix;  Reading table information for completion of table and column names  You can turn off this feature to get a quicker startup with -A    Database changed    MariaDB [zabbix]>  

(4)Configure the database for Zabbix server

[[email protected] ~]# vi /etc/zabbix/zabbix_server.conf  
DBHost=localhost  DBName=zabbix  DBUser=zabbix  DBPassword=zabbix  

(5)Configure PHP for Zabbix frontend

[[email protected] ~]# vi /etc/php.ini  
max_execution_time = 600  max_input_time = 600  memory_limit = 256M  post_max_size = 32M  upload_max_filesize = 16M  date.timezone = Asia/Shanghai  

(6)Start Zabbix server and agent processes

[[email protected] ~]# systemctl restart zabbix-server zabbix-agent httpd  [[email protected] ~]# systemctl enable zabbix-server zabbix-agent httpd  Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.  Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.  Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.  [[email protected] ~]#  
4、Configure Zabbix frontend

https://www.zabbix.com/documentation/3.0/manual/installation/install#installing_frontend

http://node1/zabbix/

原文出处:csdn -> https://blog.csdn.net/chengyuqiang/article/details/80210944

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如果侵犯你的利益,请发送邮箱到 [email protected],我们会很快的为您处理。