User Tools

Site Tools


Сервис Grafana


# apt install -y apt-transport-https software-properties-common wget

# wget -q -O - | sudo apt-key add -

# echo "deb stable main" | tee -a /etc/apt/sources.list.d/grafana.list

# apt update

# apt install grafana

# systemctl enable grafana-server.service

# systemctl start grafana-server

Интеграция с Prometheus

Configuratin->Data Source->Prometheus 
  URL: http://localhost:9090

Grafana dashboard

Import dashboard

+ Import->Import via
    prometheus-node-exporter: 1860
    prometheus-blackbox-exporter: 7587
  Data Source: Prometheus

Create dashboard

+ Create
    Name: router
      Add New Panel
        Panel Title: FastEthernet1/0 connection to LAN
        Query: A
          Metrics: 8*rate(if_in_octets{ifDescr="FastEthernet1/0",instance="router"}[1m])/1000000
          Legend: in Mbps
        Query: B
          Metrics: 8*rate(if_out_octets{ifDescr="FastEthernet1/0",instance="router"}[1m])/1000000
          Legend: out Mbps

Настройка уведомлений

# cat /etc/grafana/grafana.ini
enabled = true
host = mail.isp.un:25
;host = localhost:25
from_address = grafana@server.corpX.un
ehlo_identity = server.corpX.un
startTLS_policy = NoStartTLS
# service grafana-server restart
Alerting->Notification Channels ... 

Dashboard->Panel (name)->Edit->Alert->...->
  Evaluate every: 15s For 1m
  WHEN avg() OF query(B,1m,now) IS ABOVE 8
  Send To: userX

Apply->Save Dashboard!!!!
сервис_grafana.txt · Last modified: 2021/07/22 13:52 by admin