On Wed, 4 Nov 2020 at 23:04, Michael Thomas <[email protected]> wrote:
> Our SNMP-enabled devices are on a secure, non-routed subnet in our > datacenter. To enable snmp monitoring of them, we use a snmpd proxy[1]. > This allows us to grab snmp data from each device using the same IP > address, but a different community name. For example: > > # snmpget -v2c -On -c pdu1 snmpd.proxy.host > .1.3.6.1.2.1.1.5.0.1.3.6.1.2.1.1.5.0 = STRING: DCS_PDU_10_1 > # snmpget -v2c -On -c pdu2 snmpd.proxy.host .1.3.6.1.2.1.1.5.0 > .1.3.6.1.2.1.1.5.0 = STRING: DCS_PDU_11_1 > > Our snmp_exporter(s) run on the same host as prometheus, which is not the > same host that the snmp proxy is running on. I've generated a > snmp_exporter snmp.yml config that specified a different module for each > device: > > servertech_sentry3: &servertech_sentry3 > walk: > - 1.3.6.1.4.1.1718.3.2.2 > - 1.3.6.1.4.1.1718.3.2.3 > [...] > pdu1: > <<: *servertech_sentry3 > auth: > community: pdu1 > > pdu2: > <<: *servertech_sentry3 > auth: > community: pdu2 > > This lets us use a single exporter for all identical devices by specifying > a different module, eg > > http://prometheus.host:9116/snmp?target=snmpd.proxy.host&module=pdu1 > http://prometheus.host:9116/snmp?target=snmpd.proxy.host&module=pdu2 > > However, I'm uncertain now to use this in my prometheus.yml file so that > they show up as different targets under the same job. I wanted to do > something like this: > > - job_name: 'pdu' > static_configs: > - targets: > - 'prometheus.host:9116/snmp?target=snmpd.proxy.host&module=pdu1' > - 'prometheus.host:9116/snmp?target=snmpd.proxy.host&module=pdu2' > > ...but prometheus doesn't like having the url path in the target; it only > wants a hostname:port. But in my case, I want to reuse the same > hostname:port for multiple targets. > You will need to use relabelling to set __param_module. However a simpler idea might be to run the snmp_exporter on the machine the snmpd_proxy is currently running on. Generally you want the snmp exporter near the network devices, not Prometheus, given how chatty SNMP is. Brian > > Is this something that is possible? If not, the only other option I see > is to run a separate snmp_exporter instance (listening on different ports) > for each snmp device (we have ~50 such devices). Ultimately I want to have > a single job_name, but be able to select data for each individual proxied > snmp device in grafana. > > --Mike > [1]http://net-snmp.sourceforge.net/wiki/index.php/Snmpd_proxy > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/2038b634-8058-4eb1-836f-31acd4b95a49n%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/2038b634-8058-4eb1-836f-31acd4b95a49n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Brian Brazil www.robustperception.io -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAHJKeLpa8mkO%2BpLoZ%3DkMxOs%2BJj7dP%2BEhHfi6Y5v%3D5FHEsj0mpw%40mail.gmail.com.

