User Tools

Site Tools


сервис_prometheus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
сервис_prometheus [2023/06/24 14:34]
val [prometheus-node-exporter]
сервис_prometheus [2023/06/24 16:54]
val [prometheus-snmp-exporter]
Line 4: Line 4:
   * [[https://​habr.com/​ru/​company/​southbridge/​blog/​455290/​|Полное руководство по Prometheus в 2019 году]]   * [[https://​habr.com/​ru/​company/​southbridge/​blog/​455290/​|Полное руководство по Prometheus в 2019 году]]
   * [[https://​www.shellhacks.com/​ru/​prometheus-delete-time-series-metrics/​|Prometheus:​ Удаление Метрик Временных Рядов]]   * [[https://​www.shellhacks.com/​ru/​prometheus-delete-time-series-metrics/​|Prometheus:​ Удаление Метрик Временных Рядов]]
 +  * [[https://​habr.com/​ru/​companies/​tochka/​articles/​683608/​|Человеческим языком про метрики]]
  
 ===== Установка в Debian/​Ubuntu ===== ===== Установка в Debian/​Ubuntu =====
Line 149: Line 150:
 == node_network_receive_bytes_total == == node_network_receive_bytes_total ==
 <​code>​ <​code>​
-$ cat /​sys/​class/​net/​eth1/​statistics/​rx_bytes+$ cat /​sys/​class/​net/​eth0/​statistics/​rx_bytes
   или   или
 $ cat /​sys/​class/​net/​bond0/​statistics/​rx_bytes $ cat /​sys/​class/​net/​bond0/​statistics/​rx_bytes
Line 173: Line 174:
 8*rate(node_network_receive_bytes_total[1m]) 8*rate(node_network_receive_bytes_total[1m])
  
-8*rate(node_network_receive_bytes_total{device="​eth1"​}[1m])+8*rate(node_network_receive_bytes_total{device="​bond0"​}[1m])
  
-8*rate(node_network_receive_bytes_total{device="​eth1",​instance="​localhost:​9100",​job="​node"​}[1m])+8*rate(node_network_receive_bytes_total{device="​eth0",​instance="​localhost:​9100",​job="​node"​}[1m])
 </​code>​ </​code>​
  
Line 296: Line 297:
 <​code>​ <​code>​
 # apt install prometheus-snmp-exporter # apt install prometheus-snmp-exporter
 +</​code>​
  
 +=== Создание файла конфигурации "​вручную"​ ===
 +
 +<​code>​
 # cat /​etc/​prometheus/​snmp.yml # cat /​etc/​prometheus/​snmp.yml
 </​code><​code>​ </​code><​code>​
Line 309: Line 314:
   - 1.3.6.1.2.1.2.2.1.2   - 1.3.6.1.2.1.2.2.1.2
   metrics:   metrics:
-  - name: if_in_octets+  - name: ifInOctets
     oid: 1.3.6.1.2.1.2.2.1.10     oid: 1.3.6.1.2.1.2.2.1.10
     type: counter     type: counter
Line 321: Line 326:
       oid: 1.3.6.1.2.1.2.2.1.2       oid: 1.3.6.1.2.1.2.2.1.2
       type: DisplayString       type: DisplayString
-  - name: if_out_octets+  - name: ifOutOctets
     oid: 1.3.6.1.2.1.2.2.1.16     oid: 1.3.6.1.2.1.2.2.1.16
     type: counter     type: counter
Line 333: Line 338:
       oid: 1.3.6.1.2.1.2.2.1.2       oid: 1.3.6.1.2.1.2.2.1.2
       type: DisplayString       type: DisplayString
-</​code><​code>​+</​code>​ 
 + 
 +=== Создание файла конфигурации "​вручную"​ === 
 + 
 +<​code>​ 
 +# cp /​usr/​share/​doc/​prometheus-snmp-exporter/​examples/​generator.yml . 
 + 
 +# prometheus-snmp-generator generate 
 + 
 +# cp snmp.yml /​etc/​prometheus/​snmp.yml 
 +</​code>​ 
 + 
 +=== Примеры использования === 
 + 
 +<​code>​
 # service prometheus-snmp-exporter restart # service prometheus-snmp-exporter restart
 </​code>​ </​code>​
Line 364: Line 383:
  
 <​code>​ <​code>​
-rate(if_in_octets{ifDescr="​FastEthernet1/​1",​ifIndex="​3",​instance="​router",​job="​snmp"​}[1m])+rate(ifInOctets{ifDescr="​FastEthernet1/​1",​ifIndex="​3",​instance="​router",​job="​snmp"​}[1m])
   или   или
-rate(if_out_octets{ifIndex="​5",​instance="​router",​job="​snmp"​}[1m])+rate(ifOutOctets{ifIndex="​5",​instance="​router",​job="​snmp"​}[1m])
  
-8*rate(if_in_octets{ifDescr="​FastEthernet1/​1",​instance="​router"​}[1m])+8*rate(ifInOctets{ifDescr="​FastEthernet1/​1",​instance="​router"​}[1m])
   или   или
-8*rate(if_out_octets{ifDescr="​Port-channel1",​instance="​router"​}[1m])+8*rate(ifOutOctets{ifDescr="​Port-channel1",​instance="​router"​}[1m])
 </​code>​ </​code>​
  
сервис_prometheus.txt · Last modified: 2024/06/26 17:24 by val