snmp_exporter fails with 'Error scraping target'

537 views
Skip to first unread message

Vinod Kumar Vema

unread,
Jul 13, 2023, 3:28:42 AM7/13/23
to Prometheus Users
Hello all!

I am new to this network monitoring, I am unable to poll a firewall instance for prometheus using snmpexporter. Here is my use scenario:

I have configured snmp exporter in a docker environment, by following these steps:
        a) generated snmp.yaml using generator 
        b) updated the auth values in the snmp.yaml files
        c) tested the network connectivity using nc command to target machine with port 161/udp
        d) confirmed the connection from snmpexporter using netstat -a command, that the connection to target is established

Verified the configuration of agent for v3, at the firewall instance and found to be ok.

When i execute the snmp walk command alongwith the required parameters, I am getting error as:

snmpwalk: Timeout

Also when i find the logs of the exporter, msg="Error scraping target" err="error getting target 178.26.727.8: request timeout (after 3 retries)" 

Tried snmpget also, but no use.

Can someone, please find where i am going wrong, and how to establish the connection.

Solution is really appreciated.


Brian Candler

unread,
Jul 13, 2023, 4:45:50 AM7/13/23
to Prometheus Users
"When i execute the snmp walk command alongwith the required parameters"

Presumably you mean the snmpwalk command from the net-snmp package. If so, it means your problem is nothing at all to do with snmp_exporter, but it does show you have a general problem with SNMP that you'll need to debug.

It could be a whole range of issues, the most common being:
* problems with the query itself: see "man snmpcmd" for the options
    * you're sending a query with the wrong SNMP version (v1 or v2c)
    * you're using the wrong snmpv3 security level (authPriv | authNoPriv | noAuthNoPriv) 
    * you're using the wrong snmpv3 credentials (username, authentication key or encryption key)
    * you're using the wrong snmpv3 key types (MD5/SHA for authentication, DES/AES for encryption)
    * you're using raw hex keys instead of passphrases, or vice versa
* snmp agent has some ACL that blocks requests from your IP
* intervening firewall rules blocking snmp traffic from your IP
* snmp agent not running

It's not possible to give any more specific advice unless you show your actual snmpwalk command line, and your firewall's SNMPv3 configuration. And do remember, this is not anything to do with Prometheus or snmp_exporter, it's a problem between you and your firewall.

You might find some clues from here (the examples use authNoPriv as the security level):

Incidentally, there is a new release of snmp_exporter due shortly (0.23.0) which changes the configuration to separate MIBs from authentication credentials, which is a huge improvement. I'm using 0.23.0-rc0 now, and I'd recommend you start with this.  But you must first get queries working with snmpwalk, before you can progress to configuring and testing snmp_exporter.
Reply all
Reply to author
Forward
0 new messages