snmp_exporter related configurations.

52 views
Skip to first unread message

chintaman...@gmail.com

unread,
Feb 21, 2023, 11:07:31 PM2/21/23
to Prometheus Users
Hi All,
Are there any in-depth detailed documents and videos, which describes snmp_exporter configurations?  including some architecture details, like, 
1.  snmp_exporter should be installed on prometheus server/VM or need dedicated server/VM ?
2. From how many nodes , snmp_exporter can collect metrics ?
3. In case of overload, how can multiple snmp_exporter can connect with single (or multiple) prometheus servers.?
4. where exactly is auth: for targets? (in snmp.yml, or other file)
5. Is it essential to build using generate?

I saw few references, downloaded snmp_exporter (confirmed that prometheus server is getting SNMP response from targets), did initial configurations, added community string in auth: of snmp.yml , added config to prometheus.yml  
Still unable to reach to targets. SO wan to recheck steps by referring any detailed document for snmp_exporter

Regards,
 

chintaman...@gmail.com

unread,
Feb 21, 2023, 11:11:01 PM2/21/23
to Prometheus Users
Error details, as observed in UI.
An error has occurred while serving metrics: error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {}, variableLabels: []}: 
error getting target 192.168.1.2: request timeout (after 3 retries)

Brian Candler

unread,
Feb 22, 2023, 6:54:00 PM2/22/23
to Prometheus Users
On Wednesday, 22 February 2023 at 12:07:31 UTC+8 chintaman...@gmail.com wrote:
1.  snmp_exporter should be installed on prometheus server/VM or need dedicated server/VM ?

Either works fine, so I suggest you start simple and only make it more complex if you ever find you need to.

I've always installed snmp_exporter on the same host as prometheus itself, since both prometheus and snmp_exporter use relatively little resources; but it depends on the amount of scraping you're doing.

One reason to install snmp_exporter on a separate host would be for network reachability reasons: that is, where the remote targets are not directly reachable from the prometheus server, but you can install snmp_exporter in a location where prometheus can talk to snmp_exporter, and snmp_exporter can talk to the target hosts.

(In that sort of situation, another option is to have a second instance of prometheus in 'agent' mode, colocated with snmp_exporter; the prometheus agent then pushes metrics to a central prometheus server using remote write)
 
2. From how many nodes , snmp_exporter can collect metrics ?

As many as you like, within the resources you have.
 
3. In case of overload, how can multiple snmp_exporter can connect with single (or multiple) prometheus servers.?

It's very flexible, you just configure it how you like.

If you need multiple prometheus servers each scraping a subset of targets (sometimes called "sharding") then you could have those prometheus servers all scraping the same snmp_exporter. However, since snmp_exporter is so small and cheap, I would be inclined to give each prometheus server its own snmp_exporter instance.

The other way round, you can have a single prometheus server talking to multiple snmp_exporters, by having multiple scrape jobs - but since snmp_exporter can already make use of multiple cores, this is unlikely to have much benefit unless those snmp_exporters are located on different hosts as mentioned above..
 
4. where exactly is auth: for targets? (in snmp.yml, or other file)

In snmp.yml
 
5. Is it essential to build using generate?

No, but it can be a bit fiddly to hack snmp.yml.  You might find it's helpful to generate snmp.yml out of parts, and cat them together to form the final file to be read by snmp_exporter.

A simple trick to take the existing snmp.yml and add authentication is here:
 
I saw few references, downloaded snmp_exporter (confirmed that prometheus server is getting SNMP response from targets), did initial configurations, added community string in auth: of snmp.yml , added config to prometheus.yml  
Still unable to reach to targets. SO wan to recheck steps by referring any detailed document for snmp_exporter

I suggest you test snmp_exporter directly using curl, which keeps prometheus out of the question until you have SNMP communication working successfully.  I also suggest you start with if_mib which is the simple basic one that pretty much everything supports.

Maybe this example will help:

Reply all
Reply to author
Forward
0 new messages