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

Generator snmp.yml contains "help" field which snmp_exporter does not recognize. #214

Closed
wade-lich opened this issue Aug 10, 2017 · 3 comments

Comments

@wade-lich
Copy link

wade-lich commented Aug 10, 2017

I wanted to add more devices to the snmp.yml. I tested the default generator to make sure it was working before making changes. After moving the generated snmp.yml to the snmp_exporter folder and restarting snmp_exporter I received the following error:

systemctl status snmp_exporter -l
● snmp_exporter.service - Prometheus SNMP Exporter
Loaded: loaded (/etc/systemd/system/snmp_exporter.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-08-10 12:31:45 PDT; 29min ago
Process: 22831 ExecStart=/opt/snmp_exporter/current/snmp_exporter -config.file=/opt/snmp_exporter/current/snmp.yml (code=exited, status=1/FAILURE)
Main PID: 22831 (code=exited, status=1/FAILURE)

Aug 10 12:31:45 lasdcopspr01vm02 systemd[1]: Started Prometheus SNMP Exporter.
Aug 10 12:31:45 lasdcopspr01vm02 systemd[1]: Starting Prometheus SNMP Exporter...
Aug 10 12:31:45 lasdcopspr01vm02 snmp_exporter[22831]: time="2017-08-10T12:31:45-07:00" level=info msg="Starting snmp exporter (version=0.4.0, branch=master, revision=0a00acbf61971015b6475441d741ce59ad2ba26d)" source="main.go:99"
Aug 10 12:31:45 lasdcopspr01vm02 snmp_exporter[22831]: time="2017-08-10T12:31:45-07:00" level=info msg="Build context (go=go1.8.3, user=root@ea8b44ce07e1, date=20170606-13:39:44)" source="main.go:100"
Aug 10 12:31:45 lasdcopspr01vm02 snmp_exporter[22831]: time="2017-08-10T12:31:45-07:00" level=fatal msg="Error parsing config file: unknown fields in module: help" source="main.go:105"
Aug 10 12:31:45 lasdcopspr01vm02 systemd[1]: snmp_exporter.service: main process exited, code=exited, status=1/FAILURE
Aug 10 12:31:45 lasdcopspr01vm02 systemd[1]: Unit snmp_exporter.service entered failed state.
Aug 10 12:31:45 lasdcopspr01vm02 systemd[1]: snmp_exporter.service failed.

System details

CentOS Linux release 7.3.1611 (Core)
Linux localhost 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Generator pulled from current main two days ago

output of ./generator generate using default generator.yml.

./generator generate
INFO[0000] Loading MIBs from $HOME/.snmp/mibs:/usr/share/snmp/mibs source="net_snmp.go:83"
WARN[0001] NetSNMP reported 524 parse errors source="main.go:70"
WARN[0002] Can't find augmenting oid tokenRingMLStatsEntry for tokenRingMLStats2Entry source="tree.go:58"
WARN[0002] Can't find augmenting oid tokenRingPStatsEntry for tokenRingPStats2Entry source="tree.go:58"
WARN[0002] Can't find augmenting oid rptrPortEntry for ciscoRptrPortEntry source="tree.go:58"
INFO[0002] Generating config for module arista_sw source="main.go:30"
INFO[0002] Generated 90 metrics for module arista_sw source="main.go:33"
INFO[0002] Generating config for module default source="main.go:30"
INFO[0002] Generated 42 metrics for module default source="main.go:33"
INFO[0002] Generating config for module default_ifname source="main.go:30"
INFO[0002] Generated 42 metrics for module default_ifname source="main.go:33"
INFO[0002] Generating config for module default_ifindex source="main.go:30"
INFO[0002] Generated 42 metrics for module default_ifindex source="main.go:33"
INFO[0002] Generating config for module cisco_wlc source="main.go:30"
INFO[0002] Generated 61 metrics for module cisco_wlc source="main.go:33"
INFO[0002] Generating config for module apcups source="main.go:30"
INFO[0002] Generated 190 metrics for module apcups source="main.go:33"
INFO[0002] Generating config for module servertech_sentry3 source="main.go:30"
INFO[0002] Generated 46 metrics for module servertech_sentry3 source="main.go:33"
INFO[0002] Generating config for module paloalto_fw source="main.go:30"
INFO[0002] Generated 152 metrics for module paloalto_fw source="main.go:33"
INFO[0002] Config written to snmp.yml source="main.go:55"

Content snippet of generated snmp.yml

apcups:
walk:

  • 1.3.6.1.2.1.1.3
  • 1.3.6.1.2.1.2
  • 1.3.6.1.4.1.318.1.1.1.12
  • 1.3.6.1.4.1.318.1.1.1.2
  • 1.3.6.1.4.1.318.1.1.1.3
  • 1.3.6.1.4.1.318.1.1.1.4
  • 1.3.6.1.4.1.318.1.1.1.7.2
  • 1.3.6.1.4.1.318.1.1.1.8.1
  • 1.3.6.1.4.1.318.1.1.10.2.3.2
    metrics:
  • name: sysUpTime
    oid: 1.3.6.1.2.1.1.3
    type: gauge
    help: The time (in hundredths of a second) since the network management portion
    of the system was last re-initialized. - 1.3.6.1.2.1.1.3
  • name: ifNumber
    oid: 1.3.6.1.2.1.2.1
    type: gauge
    help: The number of network interfaces (regardless of their current state) present
    on this system. - 1.3.6.1.2.1.2.1
  • name: ifIndex
    oid: 1.3.6.1.2.1.2.2.1.1
    type: gauge
    help: A unique value, greater than zero, for each interface - 1.3.6.1.2.1.2.2.1.1
    indexes:
    • labelname: ifIndex
      type: gauge

Any help in resolving this would be appreciated.

@brian-brazil
Copy link
Contributor

At the moment you need to build the generator at the v0.4.0 tag

@wade-lich
Copy link
Author

wade-lich commented Aug 11, 2017

Thank you for the information. However, I get the following upon executing go build:

github.com/prometheus/snmp_exporter/generator

./main.go:16: undefined: Node
./main.go:77: undefined: initSNMP
./main.go:80: undefined: getMIBTree
./tree.go:13: undefined: Node
./tree.go:21: undefined: Node
./tree.go:134: undefined: Node
./main.go:80: too many errors

I deleted the original git clone, did git clone, git fetch --tags, git checkout v0.4.0. cd to generator directory and executed go build.

Did I miss something in build process?

@wade-lich
Copy link
Author

CRI. It is working as expected now. Thank you.

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

2 participants