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 [2024/06/18 16:07]
val [prometheus-snmp-exporter]
сервис_prometheus [2024/06/27 08:13]
val
Line 32: Line 32:
 !!! Ссылки содержат DNS имена !!! Ссылки содержат DNS имена
  
 +  * [[http://​192.168.X.10:​9090/​]]
   * [[http://​server.corpX.un:​9090/​targets]]   * [[http://​server.corpX.un:​9090/​targets]]
   * [[http://​server:​9090/​classic/​targets]]   * [[http://​server:​9090/​classic/​targets]]
-  * [[http://​192.168.X.10:​9090/​metrics]] 
  
 ==== Источники данных ==== ==== Источники данных ====
Line 296: Line 296:
   * [[https://​blogspot.sysadm.kz/​2018/​07/​grafana-prometheus-cisco-snmp.html|Grafana + Prometheus мониторинг траффика Cisco SNMP]]   * [[https://​blogspot.sysadm.kz/​2018/​07/​grafana-prometheus-cisco-snmp.html|Grafana + Prometheus мониторинг траффика Cisco SNMP]]
   * [[https://​medium.com/​@openmohan/​snmp-monitoring-and-easing-it-with-prometheus-b157c0a42c0c|SNMP monitoring and easing it with Prometheus]]   * [[https://​medium.com/​@openmohan/​snmp-monitoring-and-easing-it-with-prometheus-b157c0a42c0c|SNMP monitoring and easing it with Prometheus]]
 +  * [[https://​grafana.com/​blog/​2022/​02/​01/​an-advanced-guide-to-network-monitoring-with-grafana-and-prometheus/​|An advanced guide to network monitoring with Grafana and Prometheus]]
  
 <​code>​ <​code>​
Line 306: Line 307:
 # cat /​etc/​prometheus/​snmp.yml # cat /​etc/​prometheus/​snmp.yml
 </​code><​code>​ </​code><​code>​
-#if_mib  # по умолчанию,​ позволяет не указывать module в http запросе +auths
-snmp_in_out_octets:​ +  ​public_v2:
-  version: 2 +
-  ​auth:+
     community: public     community: public
-  walk+    version: 2 
-  - 1.3.6.1.2.1.2.2.1.10 +modules
-  - 1.3.6.1.2.1.2.2.1.16 +  ​if_mib: 
-  - 1.3.6.1.2.1.2.2.1.2 +    walk: 
-  metrics: +    ​- 1.3.6.1.2.1.2.2.1.10 
-  - name: ifInOctets +    - 1.3.6.1.2.1.2.2.1.16 
-    oid: 1.3.6.1.2.1.2.2.1.10 +    - 1.3.6.1.2.1.2.2.1.2 
-    type: counter +    metrics: 
-    indexes: +    - name: ifInOctets 
-    - labelname: ifIndex +      oid: 1.3.6.1.2.1.2.2.1.10 
-      type: Integer +      type: counter 
-    lookups: +      indexes: 
-    - labels: +      - labelname: ifIndex 
-      - ifIndex +        type: Integer 
-      labelname: ifDescr +      lookups: 
-      oid: 1.3.6.1.2.1.2.2.1.2 +      - labels: 
-      type: DisplayString +        - ifIndex 
-  - name: ifOutOctets +        labelname: ifDescr 
-    oid: 1.3.6.1.2.1.2.2.1.16 +        oid: 1.3.6.1.2.1.2.2.1.2 
-    type: counter +        type: DisplayString 
-    indexes: +    - name: ifOutOctets 
-    - labelname: ifIndex +      oid: 1.3.6.1.2.1.2.2.1.16 
-      type: Integer +      type: counter 
-    lookups: +      indexes: 
-    - labels: +      - labelname: ifIndex 
-      - ifIndex +        type: Integer 
-      labelname: ifDescr +      lookups: 
-      oid: 1.3.6.1.2.1.2.2.1.2 +      - labels: 
-      type: DisplayString+        - ifIndex 
 +        labelname: ifDescr 
 +        oid: 1.3.6.1.2.1.2.2.1.2 
 +        type: DisplayString
 </​code>​ </​code>​
  
Line 362: Line 364:
  
 <​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 374: Line 374:
         - 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.txt · Last modified: 2024/06/28 10:19 by val