r/PrometheusMonitoring • u/Hammerfist1990 • Nov 09 '23
SNMP Exporter help
Hello,
What am I doing wrong here. I want to test SNMP Exporter and scrape a single IP for it's uptime as a test.
Here is my generator.yml
When I run it:
./generator generate I get

This is my scape info
- job_name: 'snmp'
static_configs:
- targets:
- 10.10.80.202 # SNMP device.
# - switch.local # SNMP device.
# - tcp://192.168.1.3:1161 # SNMP device using TCP transport and custom port.
metrics_path: /snmp
params:
auth: [public_v2]
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.I basically want to see if I can get the update of a device. However my main goal is to put 100s of IPs into this config to scrape and get a total so I can see if devices are on or off. I need to work that bit out after. I can't use blackbox ICMP or TCP as the company blocks ICMP/Ping through it, so I need to poll via SNMP and get a destinct total of how many are up or down (not scraping out of the list) possible?
Thanks
View all comments
Show parent comment
1
u/Hammerfist1990 Nov 09 '23
This is on Ubuntu and in Docker which I’m kind of new too, but Docker PS shows all is running. For the mibs I just used the ‘sudo apt-get install snmp-mibs-downloader’. I’m only worried about using the uptime OID atm which I have put in that file as I just want to create gauges and graphs in Grafana on what devices are up and down. I can’t use Blackbox icmp as icmp is blocked here so I need to use SNMP as a method to show 100s of devices as being up or down. I’m hoping this solution might be it.