6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ubuntu22.04にZabbix agent6.4を導入し、監視する

Posted at

こんにちは。
株式会社クラスアクト インフラストラクチャ事業部の大塚です。

仕事関連でZabbixを触る機会が増え、適当にいじり倒せる環境が欲しいなと思う今日この頃。
なので作ってみました。
今回は前回構築したZabbix serverに監視してもらう設定を、別のubuntuサーバに設定していきたいと思います。
前回の記事は以下となります。

参考サイト

以下の公式サイトに各々の環境に合わせた環境構築の手順が記載されております。

ちなみに今回の環境構築にあたり、以下の様に設定を入れております。
image.png

構築

Zabbix agentの設定

Zabbixのリポジトリをインストールします。

root@k8s-master:~# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
root@k8s-master:~# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
root@k8s-master:~# apt update

Zabbix agent2をインストールします。

root@k8s-master:~# apt install zabbix-agent2 zabbix-agent2-plugin-*

次にZabbix agentのconfigを設定していきます。
ServerとServerActiveのパラメータをZabbix ServerのIPアドレスに設定し直します。

root@k8s-master:~# cd /etc/zabbix/
root@k8s-master:/etc/zabbix# cp -p zabbix_agent2.conf zabbix_agent2.conf.org
root@k8s-master:/etc/zabbix# vi zabbix_agent2.conf
root@k8s-master:/etc/zabbix# diff zabbix_agent2.conf zabbix_agent2.conf.org
80c80
< Server=192.168.2.222
---
> Server=127.0.0.1
133c133
< ServerActive=192.168.2.222
---
> ServerActive=127.0.0.1

Zabbix agentを再起動します。

root@k8s-master:~# systemctl restart zabbix-agent2systemctl restart zabbix-agent2
root@k8s-master:~# systemctl enable zabbix-agent2

Zabbix serverの設定

ZabbixにWebブラウザでアクセスし、ログイン
Data collectionのHostsを選択します。
image (63).png
右上のCreate hostを押下します。
image (64).png
Host name:agentの任意のホストネームを記載。
Templates:今回はubuntu22.04を監視しますので、Linux by Zabbix agentを選択。
Host group:Linux Serversを選択。
Interfaces:agentのIPアドレスを入力。
上記入力後、Addを押下します。
image (65).png
agent側のAvailabilityが緑色になればOKです。
5分程度かかると思います。
image (68).png
image (69).png

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?