관리 메뉴

IT.FARMER

exporter 설치 및 Grafana 연동 본문

모티터링도구

exporter 설치 및 Grafana 연동

아이티.파머 2020. 8. 31. 16:16
반응형

2020/08/31 - [모티터링도구] - 그라파나 키바나 차이점 (모니터링 서비스)

2020/08/31 - [모티터링도구] - Grafana 설치 pormetheus

2020/08/31 - [모티터링도구] - Grafana loki, promtail

2020/08/31 - [모티터링도구] - exporter 설치 및 Grafana 연동

2020/08/31 - [모티터링도구] - grafana Mysql Datasource 연동

exporter 설치 및 Grafana 연동

앞서 설명한것 처럼 프로메테우스는 여러가지 에이전트를 제공한다. 익스포터를 통해 프로메테우스에서 스크랩핑 할수 있도록 엔트포인트를 제공하는 에이전트를 설치한다.

node exporter

  • NIX 커널에 의해 도출된 하드웨어 및 OS 메트릭스

Monitoring Linux host metrics with the Node Exporter

 

Monitoring Linux host metrics with the Node Exporter | Prometheus

The Prometheus Node Exporter exposes a wide variety of hardware- and kernel-related metrics. In this guide, you will: Start up a Node Exporter on localhost Start up a Prometheus instance on localhost that's configured to scrape metrics from the running Nod

prometheus.io

 

node exporter 설치

wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
tar xvfz node_exporter-*.*-amd64.tar.gz
cd node_exporter-*.*-amd64
./node_exporter

# 기본 포트는 9100 번 이다.
# 메트릭스 지표 확인 
curl http://localhost:9100/metrics 
curl http://localhost:9100/metrics | grep "node_"

node exporter service 등록

sudo vim /usr/lib/systemd/system/node-exporter.service

[Unit]
Description=node-exporter
After=network-online.target

[Service]
Type=simple
User=mezzo
Group=mezzo
SyslogIdentifier=node-exporter
WorkingDirectory=/opt/promtail/node_exporter-1.0.1.linux-amd64
Restart=always
RestartSec=0s
ExecStart=/opt/promtail/node_exporter-1.0.1.linux-amd64/node_exporter

[Install]
WantedBy=multi-user.target

 

node exporter service 실행

sudo systemctl daemon-reload
sudo systemctl status node-exporter

 

prometheus 환경설정 파일 수정

프로메테우스는 서버에서 에이전트의 엔드포인트에 접근하여 데이터를 가져 가는 방식임으로

프로메테우스 서버에서 방금 설치한 node-exporter 의 endpoint 정보를 추가수집 하도록 변경해준다.

 

scrape_configs:
- job_name: node
  static_configs:
  - targets: ['192.168.0.11:9100']

prometheus 재실행

systemctl restart prometheus

프로메테우스 에 접속하여 타겟 정보확인시 정상적으로 스크랩핑 중인지 확인

 

 

 

 

Grafana Dashboard 추가

일일이 판넬을 하나씩만들수 없음으로 이미 잘만들어진 데시보드 뷰어를 임포트한다.

Node Exporter Full dashboard for Grafana

 

Node Exporter Full dashboard for Grafana

Data visualization & monitoring with support for Graphite, InfluxDB, Prometheus, Elasticsearch and many more databases

grafana.com

JSON 데이터 다운로드

Dashboard → Import → 다운로드된 JSON 데이터 임포트 → 결과 확인

반응형