Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a non-default retries value for any module affects all modules #1077

Open
lukeyeager opened this issue Dec 15, 2023 · 0 comments
Open
Labels

Comments

@lukeyeager
Copy link

Host operating system: output of uname -a

$ uname -srmo
Linux 6.6.7-arch1-1 x86_64 GNU/Linux

snmp_exporter version: output of snmp_exporter -version

$ ./snmp_exporter --version
snmp_exporter, version 0.25.0 (branch: HEAD, revision: 9c42d6c874d479314e612bca69558c81f8e26287)
  build user:       root@880115266f70
  build date:       20231210-10:05:18
  go version:       go1.21.5
  platform:         linux/amd64
  tags:             netgo

What device/snmpwalk OID are you using?

Anything. I picked the first two modules in the default snmp.yml to prove the point.

If this is a new device, please link to the MIB(s).

n/a

What did you do that produced an error?

With an unmodified snmp.yml, trying to query a non-functional SNMP server retries 3x (the default). This is good:

$ sudo nc -l -u -p 161
$ ./snmp_exporter --config.file=snmp.yml
$ curl 'localhost:9116/snmp?target=localhost&module=apcups'
An error has occurred while serving metrics:

error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {module="apcups"}, variableLabels: {}}: error getting target localhost: request timeout (after 3 retries)

Now, look what happens when I edit "retries" for a different module (arista_sw). The retries value for the apcups module has changed, too!

$ git diff
diff --git a/snmp.yml b/snmp.yml
index ce625d3..c296394 100644
--- a/snmp.yml
+++ b/snmp.yml
@@ -2372,6 +2372,7 @@ modules:
       - labelname: rPDU2BankStatusIndex
         type: gauge
   arista_sw:
+    retries: 0
     walk:
     - 1.3.6.1.4.1.30065.3.1.1
     metrics:

$ curl 'localhost:9116/snmp?target=localhost&module=apcups'
An error has occurred while serving metrics:

error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {module="apcups"}, variableLabels: {}}: error getting target localhost: request timeout (after 0 retries)

What did you expect to see?

I expected that editing "retries" for one module would not affect the retries for another module.

@RichiH RichiH added the bug label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants