こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。
今回は、Rasbian(stretch)へZabbix4.2パッケージをインストールする方法です。
9.8
root@raspberrypi:~# dpkg -l | grep zabbix
基本的には以下の通りなんですが、ちょっとはまったところがあったので、それを含めたメモです。
2 Debian/Ubuntu/Raspbian [Zabbix Documentation 4.2]
Zabbixレポジトリ使用の準備
Zabbixパッケージ用のレポジトリファイルを作成します。
以下からレポジトリファイル作成用の.debなどが取得できるので、wgetなどで取得します。
https://repo.zabbix.com/zabbix/4.2/raspbian/pool/main/z/zabbix-release/
root@raspberrypi:/tmp# wget https://repo.zabbix.com/zabbix/4.2/raspbian/pool/main/z/zabbix-release/zabbix-release_4.2-1%2Bstretch_all.deb
--2019-04-07 04:32:13-- https://repo.zabbix.com/zabbix/4.2/raspbian/pool/main/z/zabbix-release/zabbix-release_4.2-1%2Bstretch_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 162.243.159.138
Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3982 (3.9K) [application/octet-stream]
Saving to: ‘zabbix-release_4.2-1+stretch_all.deb’
zabbix-release_4.2- 100%[===================>] 3.89K --.-KB/s in 0s
2019-04-07 04:32:13 (9.74 MB/s) - ‘zabbix-release_4.2-1+stretch_all.deb’ saved [3982/3982]
root@raspberrypi:/tmp# ls
zabbix-release_4.2-1+stretch_all.deb
なお、私の環境では公式ドキュメントの通りに実行すると、「+」の文字をうまく処理できずに 404 Not Found になるので、「%2B」に変更しています。
--2019-04-07 04:30:31-- https://repo.zabbix.com/zabbix/4.2/raspbian/pool/main/z/zabbix-release/zabbix-release_4.2-2+stretch_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)... 162.243.159.138
Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-04-07 04:30:31 ERROR 404: Not Found.
debファイルのインストール。
インストール完了後、/etc/apt/source.list.dにzabbix.listというファイルが追加されます。
root@raspberrypi:/tmp# dpkg -i zabbix-release_4.2-1+stretch_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 127680 files and directories currently installed.)
Preparing to unpack zabbix-release_4.2-1+stretch_all.deb ...
Unpacking zabbix-release (4.2-1+stretch) ...
Setting up zabbix-release (4.2-1+stretch) ...
root@raspberrypi:/tmp# ls /etc/apt/sources.list.d/
raspi.list zabbix.list
root@raspberrypi:/tmp# cat /etc/apt/sources.list.d/zabbix.list
deb http://repo.zabbix.com/zabbix/4.2/raspbian stretch main
deb-src http://repo.zabbix.com/zabbix/4.2/raspbian stretch main
Zabbixパッケージのインストール
apt updateで保持しているパッケージリスト情報を更新。
root@raspberrypi:/tmp# apt update
Get:1 http://repo.zabbix.com/zabbix/4.2/raspbian stretch InRelease [4,932 B]
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Get:4 http://repo.zabbix.com/zabbix/4.2/raspbian stretch/main Sources [1,144 B]
Get:5 http://repo.zabbix.com/zabbix/4.2/raspbian stretch/main armhf Packages [3,737 B]
Fetched 9,813 B in 3s (2,553 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
aptでパッケージをインストールすればOKです。
なお、パッケージ自体は、以下からダウンロードすることもできます。
https://repo.zabbix.com/zabbix/4.2/raspbian/pool/main/z/zabbix/
root@raspberrypi:/tmp# apt install zabbix-sender zabbix-agent zabbix-get
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
zabbix-agent zabbix-get zabbix-sender
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,033 kB of archives.
After this operation, 1,887 kB of additional disk space will be used.
Get:1 http://repo.zabbix.com/zabbix/4.2/raspbian stretch/main armhf zabbix-agent armhf 1:4.2.0-1+stretch [399 kB]
Get:2 http://repo.zabbix.com/zabbix/4.2/raspbian stretch/main armhf zabbix-get armhf 1:4.2.0-1+stretch [312 kB]
Get:3 http://repo.zabbix.com/zabbix/4.2/raspbian stretch/main armhf zabbix-sender armhf 1:4.2.0-1+stretch [323 kB]
Fetched 1,033 kB in 1s (641 kB/s)
Selecting previously unselected package zabbix-agent.
(Reading database ... 127686 files and directories currently installed.)
Preparing to unpack .../zabbix-agent_1%3a4.2.0-1+stretch_armhf.deb ...
Unpacking zabbix-agent (1:4.2.0-1+stretch) ...
Selecting previously unselected package zabbix-get.
Preparing to unpack .../zabbix-get_1%3a4.2.0-1+stretch_armhf.deb ...
Unpacking zabbix-get (1:4.2.0-1+stretch) ...
Selecting previously unselected package zabbix-sender.
Preparing to unpack .../zabbix-sender_1%3a4.2.0-1+stretch_armhf.deb ...
Unpacking zabbix-sender (1:4.2.0-1+stretch) ...
Setting up zabbix-agent (1:4.2.0-1+stretch) ...
Processing triggers for systemd (232-25+deb9u9) ...
Setting up zabbix-sender (1:4.2.0-1+stretch) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up zabbix-get (1:4.2.0-1+stretch) ...
root@raspberrypi:/tmp# dpkg -l | grep zabbix
ii zabbix-agent 1:4.2.0-1+stretch armhf Zabbix network monitoring solution - agent
ii zabbix-get 1:4.2.0-1+stretch armhf Zabbix network monitoring solution - get
ii zabbix-release 4.2-1+stretch all Zabbix official repository configuration
ii zabbix-sender 1:4.2.0-1+stretch armhf Zabbix network monitoring solution - sender