mysql> CREATE DATABASE zabbix CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
(4)创建zabbix用户并授权:
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO 'zbxuser'@'%' IDENTIFIED BY 'wl874133407@WL';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
(5)测试数据库连接是否正常
4、安装配置zabbix_server段启动
(1)安装zabbix server端的数据库连接:yum install zabbix-server-mysql
(2)配置zabbix的server端数据连接:
[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf
ListenPort=10051
DBHost=127.0.0.1
DBName=zabbix
DBUser=zbxuser
DBPassword=wl874133407@WL
DBSocket=/tmp/mysql.sock
DBPort=3306
(3)导入zabbix自带数据库
[root@test ~]# zcat /usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz | mysql -uzbxuser -pwl874133407@WL zabbix
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@test ~]# mysql -uzbxuser -pwl874133407@WL
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| zabbix |
+--------------------+
2 rows in set (0.00 sec)
mysql> 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
mysql> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| alerts |
| application_discovery |
| application_prototype
............
(4)启动zabbix server端:
[root@test ~]# service zabbix-server start
5、安装zabbix的agent端
(1)安装zabbix agent端以及相关组件的安装
[root@test ~]# yum install zabbix-agent zabbix-sender zabbix-get
(2)修改zabbix的配置文件:/etc/zabbix/zabbix_agentd.conf