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 [2026/10/06 08:54]
val [prometheus-apache-exporter]
сервис_prometheus [2026/10/13 20:03] (current)
val [Настройка маршрутизации уведомлений]
Line 78: Line 78:
   email_configs:​   email_configs:​
   - to: '​student@corpX.un'​   - to: '​student@corpX.un'​
-    send_resolved:​ true 
  
-#  - name: '​script-receiver'​ +#- name: '​script-receiver'​ 
-#    webhook_configs:​ +#  webhook_configs:​ 
-#    - url: '​http://​localhost:​9000/​hooks/​my-alert-script'​+#  - url: '​http://​localhost:​9000/​hooks/​my-alert-script'​ 
 +#    send_resolved:​ false
 </​code><​code>​ </​code><​code>​
 # amtool check-config /​etc/​prometheus/​alertmanager.yml # amtool check-config /​etc/​prometheus/​alertmanager.yml
Line 88: Line 88:
 # service prometheus-alertmanager restart # service prometheus-alertmanager restart
 </​code>​ </​code>​
 +==== Подключение к alertmanager ==== 
 +  * http://​server.corpX.un:​9093/​
 ==== Тестирование alertmanager ==== ==== Тестирование alertmanager ====
 <​code>​ <​code>​
Line 96: Line 97:
       "​alertname":​ "​TestAlert",​       "​alertname":​ "​TestAlert",​
       "​severity":​ "​critical",​       "​severity":​ "​critical",​
 +      "​job":​ "​roundcube_monitor",​
       "​instance":​ "​test-host"​       "​instance":​ "​test-host"​
     },     },
Line 152: Line 154:
 #      severity: "​critical"​ #      severity: "​critical"​
 #    annotations:​ #    annotations:​
-#      summary: "Endpoint {{ $labels.instance }} down" +#      summary: "Сервис Roundcube не доступен" 
-#      dashboard_url:​ "​http://​server.corpX.un:​3000/​.../refresh=auto"+#      dashboard_url:​ "​http://​server.corpX.un:​3000/​n/nnnnnnnn/mail-app"
 </​code>​ </​code>​
  
Line 172: Line 174:
   # - "​second_rules.yml"​   # - "​second_rules.yml"​
   # - "​node_exporter_rules.yml"​   # - "​node_exporter_rules.yml"​
 +  # - "​*rules.yml"​
 ... ...
 </​code>​ </​code>​
Line 236: Line 238:
     static_configs:​     static_configs:​
       - targets: ['​localhost:​9100'​]       - targets: ['​localhost:​9100'​]
 +</​code>​
 +
 +=== collector.systemd ===
 +<​code>​
 +# cat /​etc/​default/​prometheus-node-exporter
 +</​code><​code>​
 +...
 +ARGS="​--collector.systemd"​
 </​code>​ </​code>​
  
Line 245: Line 255:
  
 8*rate(node_network_receive_bytes_total{device="​eth0",​instance="​localhost:​9100",​job="​node"​}[1m]) 8*rate(node_network_receive_bytes_total{device="​eth0",​instance="​localhost:​9100",​job="​node"​}[1m])
 +
 +node_systemd_unit_state
 +
 +node_systemd_unit_state{instance="​localhost:​9100",​job="​node",​name="​dovecot.service",​state="​active"​}
 </​code>​ </​code>​
  
Line 527: Line 541:
  
 </​code><​code>​ </​code><​code>​
-ip_dhcp_binding{dhcp_server="​router",​job="​cisco_dhcp",​net="​192.168"​}+PromQL: ​ip_dhcp_binding{dhcp_server="​router",​job="​cisco_dhcp",​net="​192.168"​}
 </​code><​code>​ </​code><​code>​
 # crontab -l # crontab -l
Line 538: Line 552:
   * Web интерфейс к почте [[Web интерфейс к почте#​Roundcube]]   * Web интерфейс к почте [[Web интерфейс к почте#​Roundcube]]
   * [[Средства программирования shell#​Тестирование Web приложения на shell]]   * [[Средства программирования shell#​Тестирование Web приложения на shell]]
-  * [[Технология cgroup]] 
  
 <​code>​ <​code>​
Line 553: Line 566:
 runtime=$(echo "$end - $start"​ | bc) runtime=$(echo "$end - $start"​ | bc)
 echo "​roundcube_login_logout_runtime ${runtime}"​ | \ echo "​roundcube_login_logout_runtime ${runtime}"​ | \
-  curl --data-binary @- http://​localhost:​9091/​metrics/​job/​roundcube_monitor/​host/​$(hostname)+  curl -Ss --data-binary @- http://​localhost:​9091/​metrics/​job/​roundcube_monitor/​host/​$(hostname)
 echo "​Выполнено за $runtime сек."​ echo "​Выполнено за $runtime сек."​
 +</​code><​code>​
 +PromQL: roundcube_login_logout_runtime
 </​code><​code>​ </​code><​code>​
 root@server:​~#​ crontab -l root@server:​~#​ crontab -l
сервис_prometheus.1791266094.txt.gz · Last modified: 2026/10/06 08:54 by val