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
сервис_prometheus [2024/06/27 08:01]
val [prometheus-snmp-exporter]
сервис_prometheus [2025/03/26 17:06] (current)
val [prometheus-alertmanager]
Line 32: Line 32:
 !!! Ссылки содержат DNS имена !!! Ссылки содержат DNS имена
  
-  * [[http://​server.corpX.un:​9090/​targets]]+  ​* [[http://​192.168.X.10:​9090/​]] 
 +  ​* [[http://​server.corpX.un:​9090/​]]
   * [[http://​server:​9090/​classic/​targets]]   * [[http://​server:​9090/​classic/​targets]]
-  * [[http://​192.168.X.10:​9090/​metrics]] 
  
 ==== Источники данных ==== ==== Источники данных ====
Line 41: Line 41:
 ===== prometheus-alertmanager ===== ===== prometheus-alertmanager =====
  
-  * [[https://​medium.com/​devops-dudes/​prometheus-alerting-with-alertmanager-e1bbba8e6a8e|Prometheus Alerting with AlertManager]]+
   * [[https://​alex.dzyoba.com/​blog/​prometheus-alerts/​|Prometheus alerts examples]]   * [[https://​alex.dzyoba.com/​blog/​prometheus-alerts/​|Prometheus alerts examples]]
-  ​* [[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://gist.github.com/krisek/62a98e2645af5dce169a7b506e999cd8|Prometheus alert rules for node exporter]]
   * [[https://​awesome-prometheus-alerts.grep.to/​|Awesome Prometheus alerts]]   * [[https://​awesome-prometheus-alerts.grep.to/​|Awesome Prometheus alerts]]
 +  * [[https://​samber.github.io/​awesome-prometheus-alerts/​rules]]
 +
 +  * [[https://​github.com/​samber/​awesome-prometheus-alerts/​tree/​master/​dist/​rules]]
 +
  
   * [[Сервис MTA#​Установка и настройка MTA на обработку почты домена hostname]]   * [[Сервис MTA#​Установка и настройка MTA на обработку почты домена hostname]]
Line 53: Line 58:
 # cat /​etc/​prometheus/​alertmanager.yml # cat /​etc/​prometheus/​alertmanager.yml
 </​code><​code>​ </​code><​code>​
-... 
 global: global:
-  smtp_smarthost:​ 'localhost:25' +  smtp_smarthost:​ 'server.corpX.un:25' 
-  smtp_from: 'prometheus@server.corpX.un'​+  smtp_from: 'alertmanager@corpX.un'​
   smtp_require_tls:​ false   smtp_require_tls:​ false
-#  smtp_auth_username: 'alertmanager+templates: 
- smtp_auth_password'​password'​ +'/​etc/​prometheus/​alertmanager_templates/​*.tmpl
-... + 
-  ​# A default receiver+route: 
 +  group_wait30s 
 +  ​group_interval:​ 5m 
 +  ​repeat_interval:​ 3h
   receiver: team-X-mails   receiver: team-X-mails
-...+
 receivers: receivers:
 - name: '​team-X-mails'​ - name: '​team-X-mails'​
   email_configs:​   email_configs:​
-#  ​- to: '​student@corpX.un' +  ​- to: '​student@corpX.un'​
-#  - to: '​userX@isp.un'+
     send_resolved:​ true     send_resolved:​ true
-... 
 </​code><​code>​ </​code><​code>​
 # service prometheus-alertmanager restart # service prometheus-alertmanager restart
Line 130: Line 135:
 </​code>​ </​code>​
  
-  * [[http://192.168.X.10:​9090/​alerts]]+  * [[http://server.corpX.un:9090/classic/alerts]]
 ===== Exporters ===== ===== Exporters =====
  
Line 213: Line 218:
     static_configs:​     static_configs:​
       - targets:       - targets:
-        - https://google.com+        - https://val.bmstu.ru
         - https://​ya.ru         - https://​ya.ru
     relabel_configs:​     relabel_configs:​
Line 253: Line 258:
 === Пример использования file-based service discovery и сервиса ping === === Пример использования file-based service discovery и сервиса ping ===
  
-  * [[https://​www.robustperception.io/​icmp-pings-with-the-blackbox-exporter|ICMP Pings with the Blackbox exporter]], [[https://​github.com/​prometheus/​blackbox_exporter|github blackbox_exporter]],​ [[POSIX capabilities]] или [[Управление ядром и модулями в Linux#​Переменные ядра]]+  * [[https://​www.robustperception.io/​icmp-pings-with-the-blackbox-exporter|ICMP Pings with the Blackbox exporter]], [[https://​github.com/​prometheus/​blackbox_exporter?​tab=readme-ov-file#​permissions|github blackbox_exporter ​permissions]], [[POSIX capabilities]] или [[Управление ядром и модулями в Linux#​Переменные ядра]]
  
 <​code>​ <​code>​
Line 355: Line 360:
 </​code>​ </​code>​
  
-=== Примеры использования === 
  
 +=== Проверка конфигурации и перезапуск prometheus-snmp-exporter ===
 <​code>​ <​code>​
 +# prometheus-snmp-exporter --dry-run
 +
 # service prometheus-snmp-exporter restart # service prometheus-snmp-exporter restart
 </​code>​ </​code>​
 +
 +=== Примеры использования ===
  
   * [[http://​server.corpX.un:​9116/​]]   * [[http://​server.corpX.un:​9116/​]]
  
 <​code>​ <​code>​
-# curl --noproxy 127.0.0.1 '​http://​127.0.0.1:​9116/​snmp?​target=router&​module=snmp_in_out_octets'​ 
-  или 
 # curl '​http://​127.0.0.1:​9116/​snmp?​target=router'​ # curl '​http://​127.0.0.1:​9116/​snmp?​target=router'​
 </​code><​code>​ </​code><​code>​
Line 376: Line 383:
         - router         - router
     metrics_path:​ /snmp     metrics_path:​ /snmp
-    params: ​                              # no need  
-      module: [snmp_in_out_octets] ​       # if if_mib 
     relabel_configs:​     relabel_configs:​
       - source_labels:​ [__address__]       - source_labels:​ [__address__]
сервис_prometheus.1719464486.txt.gz · Last modified: 2024/06/27 08:01 by val