User Tools

Site Tools


packet:linbpq_monitoring

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:linbpq_monitoring [2024/05/14 17:43] – [Telegraf / Grafana] m0ltepacket:linbpq_monitoring [2024/05/15 10:05] (current) – [Prometheus] remove note about sysUpTime 2m0mqn
Line 129: Line 129:
 ===== Telegraf / Grafana ===== ===== Telegraf / Grafana =====
  
-Another way to collect and monitor BPQ's SNMP metrics is by using Telegraf. You typically run Telegraf as part of a monitoring stack, in this case Telegraf + InfluxDB + Grafana.+Another way to collect and monitor BPQ's SNMP metrics is by using Telegraf. You typically run Telegraf as part of a monitoring stack, in this case Telegraf + InfluxDB + Grafana. Telegraf is the collection agent, InfluxDB is the time-series database, and Grafana is the visualisation.
  
 In telegraf.conf: In telegraf.conf:
Line 152: Line 152:
 </code> </code>
  
-These counters show up in InfluxDB under a measurement named SNMP with multiple fields, one for each oid.+These counters show up in InfluxDB under a measurement named SNMP with multiple fields, one for each oid. You get a counter update every 10 seconds.
  
 Query like this: Query like this:
Line 161: Line 161:
  
 {{:packet:linbpq-snmp-grafana.png?800|}} {{:packet:linbpq-snmp-grafana.png?800|}}
 +
 +===== Prometheus =====
 +
 +It's also quite easy to get prometheus-snmp-exporter to collect stats from BPQ.
 +
 +Add something like the following to your generator.yml
 +
 +<code>
 +  linbpq:
 +    walk:
 +      - 1.3.6.1.2.1.1.3.0
 +      - 1.3.6.1.2.1.1.5
 +      - 1.3.6.1.2.1.2.2.1.10.1
 +      - 1.3.6.1.2.1.2.2.1.16.1
 +    version: 1
 +    auth:
 +      community: public
 +</code>
 +
 +Repeat the 1.3.6.1.2.1.2.2.1.10.X and 1.3.6.1.2.1.2.2.1.16.X lines for each of your ports, then run prometheus-snmp-generator generate to regenerate your configuration.
 +
 +You'll likely already have an snmp scrape configuration in your prometheus.yml.
 +Add the linbpq module (as defined above) and the target address of your BPQ node to it.
 +The result will look something like this:
 +
 +<code>
 +  - job_name: 'snmp'
 +    scrape_interval: 20s
 +    scrape_timeout: 5s
 +    metrics_path: /snmp
 +    params:
 +      module: [linbpq]
 +    static_configs:
 +      - targets:
 +        - packet.example.org:8161  # SNMP device - add your IPs here
 +    relabel_configs:
 +      - source_labels: [__address__]
 +        target_label: __param_target
 +      - source_labels: [__param_target]
 +        target_label: instance
 +      - target_label: __address__
 +        replacement: 127.0.0.1:9116  # SNMP exporter.
 +</code>
 +
 +After restarting prometheus-snmp-exporter and prometheus you should start seeing ifInOctets, ifOutOctets, sysName, and sysUpTime metrics appearing.
 +
packet/linbpq_monitoring.1715708620.txt.gz · Last modified: 2024/05/14 17:43 by m0lte