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

error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {module="okiprinter"}, variableLabels: {}}: error walking target ipv4: not in time window #1114

Open
bbqrob opened this issue Feb 12, 2024 · 0 comments

Comments

@bbqrob
Copy link

bbqrob commented Feb 12, 2024

Host operating system: output of uname -a

Linux dev-bvml-003 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

snmp_exporter version: output of snmp_exporter -version

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

Running from the container prom/snmp-exporter:v0.25.0

What device/snmpwalk OID are you using?

1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3 on Printer OKI ES5473 MFP

What did you do that produced an error?

Using this generator.yml:

auths:
  okiprinter:
    version: 3
    username: snmp
    password: <pass here>
    security_level: authPriv
    priv_password: <pass here>
    context_name: v3context
  brotherprinter:
    version: 1
    community: public

modules:
  okiprinter:
    walk:
      - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.1
      - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.2
      - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.3
      - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.4
  brotherprinter:
    walk:
	  # this one should not interfere
      - 1.3.6.1.2.1.43.12.1.1.4.1.1
      - 1.3.6.1.2.1.43.12.1.1.4.1.2
      - 1.3.6.1.2.1.43.12.1.1.4.1.3
      - 1.3.6.1.2.1.43.12.1.1.4.1.4

ended in the following snmp.yaml:

# WARNING: This file was auto-generated using snmp_exporter generator, manual changes will be lost.
auths:
  brotherprinter:
    community: public
    security_level: noAuthNoPriv
    auth_protocol: MD5
    priv_protocol: DES
    version: 1
  okiprinter:
    community: public
    security_level: authPriv
    username: snmp
    password: <pass here>
    auth_protocol: MD5
    priv_protocol: DES
    priv_password: <pass here>
    context_name: v3context
    version: 3
modules:
  brotherprinter:
    get:
    - 1.3.6.1.2.1.43.12.1.1.4.1.1
    - 1.3.6.1.2.1.43.12.1.1.4.1.2
    - 1.3.6.1.2.1.43.12.1.1.4.1.3
    - 1.3.6.1.2.1.43.12.1.1.4.1.4
    metrics:
    - name: prtMarkerColorantValue
      oid: 1.3.6.1.2.1.43.12.1.1.4
      type: OctetString
      help: 'The name of the color of this colorant using standardized string names
        from ISO 10175 (DPA) and ISO 10180 (SPDL) such as: other unknown white red
        green blue cyan magenta yellow black Implementers may add additional string
        values - 1.3.6.1.2.1.43.12.1.1.4'
      indexes:
      - labelname: hrDeviceIndex
        type: gauge
      - labelname: prtMarkerColorantIndex
        type: gauge
  okiprinter:
    get:
    - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.1
    - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.2
    - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.3
    - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.4
    metrics:
    - name: usageTonerCurrentLevel
      oid: 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3
      type: DisplayString
      help: usage Toner Current Level - 1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3
      indexes:
      - labelname: usageTonerIndex
        type: gauge

which is used in the container. When trying to call the address http://127.0.0.1:9116/snmp?target=ipv4.here&module=okiprinter&auth=okiprinter

Unluckily I get the result

ts=2024-02-12T14:28:30.959Z caller=main.go:194 level=info msg="Starting snmp_exporter" version="(version=0.25.0, branch=HEAD, revision=9c42d6c874d479314e612bca69558c81f8e26287)" concurrency=1
ts=2024-02-12T14:28:30.960Z caller=main.go:195 level=info build_context="(go=go1.21.5, platform=linux/amd64, user=root@880115266f70, date=20231210-10:05:18, tags=netgo)"
ts=2024-02-12T14:28:30.962Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
ts=2024-02-12T14:28:30.962Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
ts=2024-02-12T14:30:43.088Z caller=collector.go:460 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Starting scrape"
ts=2024-02-12T14:30:43.089Z caller=collector.go:214 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Walking subtree" oid=1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.1
ts=2024-02-12T14:34:43.180Z caller=collector.go:393 level=info auth=okiprinter target=<ipv4 here> module=okiprinter msg="Error scraping target" err="error walking target <ipv4 here>: not in time window"
ts=2024-02-12T14:34:43.180Z caller=collector.go:464 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Finished scrape" duration_seconds=240.091531366

When doing this with snmpwalk or snmpbulkget, i'm getting the following results:

.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.1 = STRING: "79"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.2 = STRING: "98"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.3 = STRING: "72"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.4 = STRING: "94"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.4.1 = STRING: "100"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.4.2 = STRING: "100"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.4.3 = STRING: "100"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.4.4 = STRING: "100"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.5.1 = STRING: "Percent"
.1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.5.2 = STRING: "Percent"

What did you expect to see?

See above

What did you see instead?

From the logs:

ts=2024-02-12T14:28:30.959Z caller=main.go:194 level=info msg="Starting snmp_exporter" version="(version=0.25.0, branch=HEAD, revision=9c42d6c874d479314e612bca69558c81f8e26287)" concurrency=1
ts=2024-02-12T14:28:30.960Z caller=main.go:195 level=info build_context="(go=go1.21.5, platform=linux/amd64, user=root@880115266f70, date=20231210-10:05:18, tags=netgo)"
ts=2024-02-12T14:28:30.962Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
ts=2024-02-12T14:28:30.962Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
ts=2024-02-12T14:30:43.088Z caller=collector.go:460 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Starting scrape"
ts=2024-02-12T14:30:43.089Z caller=collector.go:214 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Walking subtree" oid=1.3.6.1.4.1.2001.1.1.1.1.100.3.1.1.3.1
ts=2024-02-12T14:34:43.180Z caller=collector.go:393 level=info auth=okiprinter target=<ipv4 here> module=okiprinter msg="Error scraping target" err="error walking target <ipv4 here>: not in time window"
ts=2024-02-12T14:34:43.180Z caller=collector.go:464 level=debug auth=okiprinter target=<ipv4 here> module=okiprinter msg="Finished scrape" duration_seconds=240.091531366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant