Skip to content

yuimamur/Zabbix-Grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Zabbix-Grafana

Grafana インストール

レポジトリ追加

[admin@bb-amazonlinux2 ~]$ cat /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

Grafana インストール

[root@bb-amazonlinux2 admin]# yum install -y grafana

Grafana サービス起動

[root@bb-amazonlinux2 admin]# systemctl daemon-reload
[root@bb-amazonlinux2 admin]# systemctl start grafana-server
[root@bb-amazonlinux2 admin]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)
   Active: active (running) since 火 2023-10-24 16:23:30 JST; 7s ago
     Docs: https://docs.grafana.org
 Main PID: 58897 (grafana)
   CGroup: /system.slice/grafana-server.service
           └─58897 /usr/share/grafana/bin/grafana server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana...
[root@bb-amazonlinux2 admin]# systemctl enable grafana-server
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.

Grafanaバージョンの確認

[root@bb-amazonlinux2 admin]# grafana-cli -v
grafana-cli -v
grafana version 10.1.5

Zabbixプラグインのインストール

[root@bb-amazonlinux2 admin]# grafana-cli plugins install alexanderzobnin-zabbix-app
✔ Downloaded and extracted alexanderzobnin-zabbix-app v4.4.3 zip successfully to /var/lib/grafana/plugins/alexanderzobnin-zabbix-app
Please restart Grafana after installing or removing plugins. Refer to Grafana documentation for instructions if necessary.

[root@bb-amazonlinux2 admin]# systemctl restart grafana-server

Grafanaへアクセス

https://localhost:3000 へアクセスする。
image

ログインすると、下記のダッシュボードへアクセス可能になる。
image



Grafana設定

Administration > Plugins から Zabbixを選択する。

image

インストールと同時にEnableに設定する。

image

Connections > Add New Connection へアクセスし、MySQLをクリックする。
Zabbixインストール時に設定したMySQLの情報を設定する。

image

Data Sources から Addを選択し、Zabbixを追加する。
Zabbixの項目にて、必要な情報を入力する。

HTTP
URL : https://192.168.5.152/zabbix/api_jsonrpc.php
Access : Server

Zabbix API details
Auth type : User and Password
Username : ユーザ名
Password : パスワード
image

ダッシュボードの作成

Build Dashboard からダッシュボードを作成する。

image
Query type : Text
Group : Zabbix servers
Host : /.*/
Application : Zabbix raw items
Item : 追加したアイテム(test)

Zabbix側に追加されたデータがGrafana側で確認できる。

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published