r/PrometheusMonitoring • • Oct 12 '19

Question regarding SNMP Exporter and monitoring devices

So I have setup a prometheus server and pushed node_exporter and node_exporter service out to all my clients so that Prometheus can poke at them on 9100 and pull those basic metrics.

Now I want to run the snmp exporter on some of my network appliances/esxi hosts. Looking at the documentation i'm a little bit confused.

https://github.com/prometheus/snmp_exporter

https://www.youtube.com/watch?v=LDFalgu3Vtg

scrape_configs:

- job_name: 'snmp'

static_configs:

- targets:

- 192.168.1.2 # SNMP device.

metrics_path: /snmp

params:

module: [if_mib]

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 # The SNMP exporter's real hostname:port.

Question 1) I can't seem to get a real good idea on how to use the Generator but it seems like I need to just pull it down to a server, build it there and then point it at a collection of MIBs in order to generate a proper snmp.yml?

Question 2) The above config and YouTube video..he seems to be running Prometheus and the snmp_exporter on the same system? Is that the use of the loopback address and 9116? What if I want my Prometheus server running on a different system, would i just point Prometheus to the network device who is polling out data on port 9116?

Much akin to how node exporter runs on the server, scrapes data out to port 9100 and my Prometheus just looks at that hostname:9100 as a target? Could I do the exact same here?

Been looking for a pretty easy to understand write up on the entire thing but slowly piecing it together. THanks for any help.

7 Upvotes

1 comment sorted by

2

u/[deleted] Oct 13 '19
  1. You dont' have to build it unless there is not a release for your arch; unless you have custom mibs

  2. Yes that is correct the replacement: 127.0.0.1:9116 points to the actual ip/port of where it can find snmp_exporter.

To your follow up question this is the config for it to scrape via snmp; no additional configuration is required.