(53条消息) zabbix4.0 服务搭建_linus.lin的博客-CSDN博客
wcx@ubuntu:~$ whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
wcx@ubuntu:~$ which mysql
/usr/bin/mysql
which是搜索PATH路径
/
以下,一直配置的是server,服务器端
-
wcx@ubuntu:~$ cat /etc/issue
-
wcx@ubuntu:~$ cd /usr/local/src/
-
wcx@ubuntu:/usr/local/src$ sudo wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix- release/zabbix-release_4.0-3+bionic_all.deb
-
wcx@ubuntu:/usr/local/src$ dpkg -c zabbix-release_4.0-3+bionic_all.deb
-
wcx@ubuntu:/usr/local/src$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
-
wcx@ubuntu:/usr/local/src$ cat /etc/apt/sources.list.d/zabbix.list
-
wcx@ubuntu:/usr/local/src$ apt update
-
wcx@ubuntu:/usr/local/src$ apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
11.wcx@ubuntu: sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
安装了三个,zabbix-server-mysql ,zabbix-frontend-php, zabbix-agent
-
sudo apt install mysql-server
-
mysql
-
cx@ubuntu:/usr/local/src$ ss -tnl 查看mysql的配置
-
sudo mysql
-
mysql>create database zabbix server character set utf8 collate utf8_bin;
-
mysql>grant all privileges on zabbix_server.*to zhangsan@“127.0.0.1” identified by ‘123456’;
-
-
mysql数据库配置完成,接下来要做的就是导入数据。
创建数据库
create database zabbix server character set utf8 collate utf8_bin;
grant all privileges on zabbix_server.*to zhangsan@"127.0.0.1" identified by '123456';
然后创建表,
wcx@ubuntu:~$ cat /etc/issue
Ubuntu 18.04.6 LTS \n \l
wcx@ubuntu:~$ cd /usr/local/src/
wcx@ubuntu:/usr/local/src$ wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
--2021-12-11 06:26:47-- https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 178.128.6.101, 2604:a880:2:d0::2062:d001
Connecting to repo.zabbix.com (repo.zabbix.com)|178.128.6.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4068 (4.0K) [application/octet-stream]
zabbix-release_4.0-3+bionic_all.deb: Permission denied
Cannot write to ‘zabbix-release_4.0-3+bionic_all.deb’ (Success).
wcx@ubuntu:/usr/local/src$ ^C
wcx@ubuntu:/usr/local/src$ sudo wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
[sudo] password for wcx:
--2021-12-11 06:28:41-- https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 178.128.6.101, 2604:a880:2:d0::2062:d001
Connecting to repo.zabbix.com (repo.zabbix.com)|178.128.6.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4068 (4.0K) [application/octet-stream]
Saving to: ‘zabbix-release_4.0-3+bionic_all.deb’
zabbix-release_4.0- 100%[==================>] 3.97K --.-KB/s in 0s
2021-12-11 06:28:42 (831 MB/s) - ‘zabbix-release_4.0-3+bionic_all.deb’ saved [4068/4068]
wcx@ubuntu:/usr/local/src$ dpkg -c zabbix-release_4.0-3+bionic_all.deb
drwxr-xr-x root/root 0 2019-07-30 09:34 ./
drwxr-xr-x root/root 0 2019-07-30 09:34 ./etc/
drwxr-xr-x root/root 0 2019-07-30 09:34 ./etc/apt/
drwxr-xr-x root/root 0 2019-07-30 09:34 ./etc/apt/sources.list.d/
-rw-r--r-- root/root 118 2019-07-30 09:34 ./etc/apt/sources.list.d/zabbix.list
drwxr-xr-x root/root 0 2019-07-30 09:34 ./etc/apt/trusted.gpg.d/
-rwxr-xr-x root/root 2083 2019-07-30 09:34 ./etc/apt/trusted.gpg.d/zabbix-official-repo.gpg
drwxr-xr-x root/root 0 2019-07-30 09:34 ./usr/
drwxr-xr-x root/root 0 2019-07-30 09:34 ./usr/share/
drwxr-xr-x root/root 0 2019-07-30 09:34 ./usr/share/doc/
drwxr-xr-x root/root 0 2019-07-30 09:34 ./usr/share/doc/zabbix-release/
-rw-r--r-- root/root 267 2019-07-30 09:17 ./usr/share/doc/zabbix-release/README.Debian
-rw-r--r-- root/root 1665 2019-07-30 09:34 ./usr/share/doc/zabbix-release/changelog.Debian
-rw-r--r-- root/root 561 2019-07-30 09:17 ./usr/share/doc/zabbix-release/copyright
wcx@ubuntu:/usr/local/src$ dpkg -i zabbix-release_4.0-3+bionic_all.deb
dpkg: error: requested operation requires superuser privilege
wcx@ubuntu:/usr/local/src$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 163832 files and directories currently installed.)
Preparing to unpack zabbix-release_4.0-3+bionic_all.deb ...
Unpacking zabbix-release (1:4.0-3+bionic) ...
Setting up zabbix-release (1:4.0-3+bionic) ...
wcx@ubuntu:/usr/local/src$ cat /etc/apt/sources.list.d/zabbix.list
deb http://repo.zabbix.com/zabbix/4.0/ubuntu bionic main
deb-src http://repo.zabbix.com/zabbix/4.0/ubuntu bionic main
wcx@ubuntu:/usr/local/src$ apt update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
wcx@ubuntu:/usr/local/src$ apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
wcx@ubuntu:/usr/local/src$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
wcx@ubuntu:/usr/local/src$ ^C
wcx@ubuntu:/usr/local/src$
```bash