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
Last revision Both sides next revision
сервис_prometheus [2021/04/20 12:14]
val [Пример prometheus pushgateway на bash]
сервис_prometheus [2022/03/10 16:04]
val [prometheus-alertmanager]
Line 5: Line 5:
   * [[https://​www.shellhacks.com/​ru/​prometheus-delete-time-series-metrics/​|Prometheus:​ Удаление Метрик Временных Рядов]]   * [[https://​www.shellhacks.com/​ru/​prometheus-delete-time-series-metrics/​|Prometheus:​ Удаление Метрик Временных Рядов]]
  
-===== Установка в Debian ​10 ===== +===== Установка в Debian/​Ubuntu ​=====
- +
-  * [[Сервис MTA#​Установка и настройка MTA на обработку почты домена hostname]]+
  
 <​code>​ <​code>​
 # apt install prometheus # apt install prometheus
 +
 +# less /​etc/​prometheus/​prometheus.yml
 +</​code><​code>​
 +...
 +global:
 +  scrape_interval: ​    15s
 +...
 </​code>​ </​code>​
  
Line 24: Line 29:
  
   * [[http://​server.corpX.un:​9090/​targets]]   * [[http://​server.corpX.un:​9090/​targets]]
 +  * [[http://​server:​9090/​classic/​targets]]
   * [[http://​192.168.X.10:​9090/​metrics]]   * [[http://​192.168.X.10:​9090/​metrics]]
   * [[http://​10.5.N.100+X:​9090/​graph]]   * [[http://​10.5.N.100+X:​9090/​graph]]
Line 36: Line 42:
   * [[https://​www.digitalocean.com/​community/​tutorials/​how-to-use-alertmanager-and-blackbox-exporter-to-monitor-your-web-server-on-ubuntu-16-04|How To Use Alertmanager And Blackbox Exporter To Monitor Your Web Server On Ubuntu 16.04]]   * [[https://​www.digitalocean.com/​community/​tutorials/​how-to-use-alertmanager-and-blackbox-exporter-to-monitor-your-web-server-on-ubuntu-16-04|How To Use Alertmanager And Blackbox Exporter To Monitor Your Web Server On Ubuntu 16.04]]
   * [[https://​awesome-prometheus-alerts.grep.to/​|Awesome Prometheus alerts]]   * [[https://​awesome-prometheus-alerts.grep.to/​|Awesome Prometheus alerts]]
 +
 +  * [[Сервис MTA#​Установка и настройка MTA на обработку почты домена hostname]]
  
 <​code>​ <​code>​
Line 47: Line 55:
   smtp_from: '​prometheus@server.corpX.un'​   smtp_from: '​prometheus@server.corpX.un'​
   smtp_require_tls:​ false   smtp_require_tls:​ false
 +#  smtp_auth_username:​ '​alertmanager'​
 +#  smtp_auth_password:​ '​password'​
 ... ...
   # A default receiver   # A default receiver
Line 59: Line 69:
 ... ...
 </​code><​code>​ </​code><​code>​
 +# service prometheus-alertmanager restart
 +
 # cat /​etc/​prometheus/​first_rules.yml # cat /​etc/​prometheus/​first_rules.yml
 </​code><​code>​ </​code><​code>​
Line 114: Line 126:
 ... ...
 </​code>​ </​code>​
 +
 +  * [[http://​192.168.X.10:​9090/​alerts]]
 ===== Exporters ===== ===== Exporters =====
  
Line 136: Line 150:
 <​code>​ <​code>​
 $ cat /​sys/​class/​net/​eth1/​statistics/​rx_bytes $ cat /​sys/​class/​net/​eth1/​statistics/​rx_bytes
 +  или
 +$ cat /​sys/​class/​net/​bond0/​statistics/​rx_bytes
  
 # TYPE node_network_receive_bytes_total counter # TYPE node_network_receive_bytes_total counter
Line 187: Line 203:
 # cat /​etc/​prometheus/​prometheus.yml # cat /​etc/​prometheus/​prometheus.yml
 </​code><​code>​ </​code><​code>​
 +...
   - job_name: check_http   - job_name: check_http
     metrics_path:​ /probe     metrics_path:​ /probe
Line 193: Line 210:
     static_configs:​     static_configs:​
       - targets:       - targets:
-        - http://val.bmstu.ru+        - https://google.com
         - https://​ya.ru         - https://​ya.ru
     relabel_configs:​     relabel_configs:​
Line 264: Line 281:
 </​code><​code>​ </​code><​code>​
 # cat /​etc/​prometheus/​switchs.yml # cat /​etc/​prometheus/​switchs.yml
 +</​code><​code>​
 - targets: - targets:
   - switch1   - switch1
Line 347: Line 365:
 <​code>​ <​code>​
 rate(if_in_octets{ifDescr="​FastEthernet1/​1",​ifIndex="​3",​instance="​router",​job="​snmp"​}[1m]) rate(if_in_octets{ifDescr="​FastEthernet1/​1",​ifIndex="​3",​instance="​router",​job="​snmp"​}[1m])
 +  или
 +rate(if_out_octets{ifIndex="​5",​instance="​router",​job="​snmp"​}[1m])
  
 8*rate(if_in_octets{ifDescr="​FastEthernet1/​1",​instance="​router"​}[1m]) 8*rate(if_in_octets{ifDescr="​FastEthernet1/​1",​instance="​router"​}[1m])
 +  или
 +8*rate(if_out_octets{ifDescr="​Port-channel1",​instance="​router"​}[1m])
 </​code>​ </​code>​
  
Line 360: Line 382:
 </​code><​code>​ </​code><​code>​
 ... ...
-  - job_name: 'Pushgateway'+  - job_name: 'pushgateway'
     honor_labels:​ true     honor_labels:​ true
     static_configs:​     static_configs:​
сервис_prometheus.txt · Last modified: 2022/03/24 17:03 by val