Commit 694220aa authored by Tô Thành Công's avatar Tô Thành Công

cập nhật hướng dẫn

cập nhật hướng dẫn
parent d24aa479
#### Các ghi chép về Grafana
### Cài đặt grafana
- Môi trường cài đặt
```sh
```
- Các lệnh cài đặt
```sh
echo "deb https://packagecloud.io/grafana/stable/debian/ wheezy main" >> /etc/apt/sources.list
curl https://packagecloud.io/gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install grafana
```
- Khởi động grafana
```sh
sudo service grafana-server start
```
- Khởi động cùng OS
```sh
sudo update-rc.d grafana-server defaults 95 10
```
##### Cấu hình cho zabbix
```sh
Tham khảo: https://github.com/alexanderzobnin/grafana-zabbix
```
- Download plugin zabbix cho grafana tu link
```sh
https://github.com/alexanderzobnin/grafana-zabbix/releases/tag/v2.5.1
hoặc
https://github.com/alexanderzobnin/grafana-zabbix
```
- Giải nén file
```sh
apt-get install unzip
unzip grafana-zabbix-2.5.1.zip
```
- Copy thư mục zabbix vừa giải nén vào thư mục plugin của grafana
```sh
cp -r /root/grafana-zabbix-2.5.1/zabbix/ /usr/share/grafana/public/app/plugins/datasource/
```
- Sửa file `plugin.json` trong thư mục `/usr/share/grafana/public/app/plugins/datasource/zabbix` như sau (thêm 2 dòng username và password)
```sh
{
"pluginType": "datasource",
"name": "Zabbix",
"type": "zabbix",
"serviceName": "ZabbixAPIDatasource",
"module": "app/plugins/datasource/zabbix/datasource",
"partials": {
"config": "app/plugins/datasource/zabbix/partials/config.html"
},
"username": "admin",
"password": "DATA2o016ZaBB1x",
"metrics": true,
"annotations": true
}
```
- Khởi động lại grafana
```sh
service grafana-server restart
```
#### Phía client
##### Các bước add trên Zabbix
![plugincpu](/images/grafana-zabbix1.png)
![plugincpu](/images/grafana-zabbix2.png)
```sh
5: Khai báo đường dẫn như sau
http://IP_CUA_MAY_CHU_ZABBIX/zabbix/api_jsonrpc.php
6: Chọn proxy
7: Tài khoản của Zabbix
8: Mật khẩu của Zabbix
```
![plugincpu](/images/grafana-zabbix3.png)
\ No newline at end of file
#### Các ghi chép về Grafana
### Các chú ý trong grafana
### Cài đặt grafana
- Môi trường cài đặt
```sh
```
- Các lệnh cài đặt
```sh
echo "deb https://packagecloud.io/grafana/stable/debian/ wheezy main" >> /etc/apt/sources.list
curl https://packagecloud.io/gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install grafana
```
- Khởi động grafana
```sh
sudo service grafana-server start
```
- Khởi động cùng OS
```sh
sudo update-rc.d grafana-server defaults 95 10
```
##### Cấu hình cho zabbix
```sh
Tham khảo: https://github.com/alexanderzobnin/grafana-zabbix
```
- Download plugin zabbix cho grafana tu link
```sh
https://github.com/alexanderzobnin/grafana-zabbix/releases/tag/v2.5.1
hoặc
https://github.com/alexanderzobnin/grafana-zabbix
```
- Giải nén file
```sh
apt-get install unzip
unzip grafana-zabbix-2.5.1.zip
```
- Copy thư mục zabbix vừa giải nén vào thư mục plugin của grafana
```sh
cp -r /root/grafana-zabbix-2.5.1/zabbix/ /usr/share/grafana/public/app/plugins/datasource/
```
- Sửa file `plugin.json` trong thư mục `/usr/share/grafana/public/app/plugins/datasource/zabbix` như sau (thêm 2 dòng username và password)
```sh
{
"pluginType": "datasource",
"name": "Zabbix",
"type": "zabbix",
"serviceName": "ZabbixAPIDatasource",
"module": "app/plugins/datasource/zabbix/datasource",
"partials": {
"config": "app/plugins/datasource/zabbix/partials/config.html"
},
"username": "admin",
"password": "DATA2o016ZaBB1x",
"metrics": true,
"annotations": true
}
```
- Khởi động lại grafana
```sh
service grafana-server restart
```
#### Phía client
##### Các bước add trên Zabbix
![plugincpu](/images/grafana-zabbix1.png)
![plugincpu](/images/grafana-zabbix2.png)
```sh
5: Khai báo đường dẫn như sau
http://IP_CUA_MAY_CHU_ZABBIX/zabbix/api_jsonrpc.php
6: Chọn proxy
7: Tài khoản của Zabbix
8: Mật khẩu của Zabbix
```
![plugincpu](/images/grafana-zabbix3.png)
\ No newline at end of file
- Từ bản 2.0 trở đi, khai báo datasource đã được đưa lên dashboard nên không phải khai báo trong file config.js như trước nữa.
- Việc khai báo datasource trên dashboard sẽ sử dụng database để lưu trữ do vậy không cần sử dụng Elasticsearch nữa.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment