Error in generating config file using generator

67 views
Skip to first unread message

sabarish narayanan

unread,
Sep 14, 2020, 2:42:19 AM9/14/20
to Prometheus Users

Hi,
I am trying to generate snmp.yml by using the generator. This is my generator file :-

modules:
  XPPC-MIB:
    walk
      - .1.3.6.1.4.1.935.1.1.1.8.3.2.0
    version3
    max_repetitions25
    retries3
    timeout10s
    auth:
      username: ********
      security_levelauthNoPriv
      password: *********
      auth_protocolMD5

I am getting the following error :-

level=info ts=2020-09-14T06:12:47.382Z caller=net_snmp.go:142 msg="Loading MIBs" from=$HOME/.snmp/mibs:/usr/share/snmp/mibs
level=info ts=2020-09-14T06:12:47.530Z caller=main.go:52 msg="Generating config for module" module=XPPC-MIB
level=error ts=2020-09-14T06:12:47.538Z caller=main.go:130 msg="Error generating config netsnmp" err="cannot find oid '.1.3.6.1.4.1.935.1.1.1.8.3.2.0' to walk"

If I try snmptranslate, it works :-

snmptranslate -mALL .1.3.6.1.4.1.935.1.1.1.8.3.2.0
XPPC-MIB::upsThreePhaseOutputVoltageR.0

snmpwalk to that oid also gives the value of the oid :-

snmpwalk -l authNoPriv -u ******** -a MD5 -A ********* XX.XX.XX.XX .1.3.6.1.4.1.935.1.1.1.8.3.2.0
SNMPv2-SMI::enterprises.935.1.1.1.8.3.2.0 = INTEGER: 2323

So I'm pretty sure that netsnmp is working fine.
The XPPC-MIB.txt file is in /usr/share/snmp/mibs.

I'm working on Centos 8.

What am I doing wrong? Any help is appreciated.
Thanks.

Ben Kochie

unread,
Sep 14, 2020, 3:21:41 AM9/14/20
to sabarish narayanan, Prometheus Users
Drop the last 0.

The easier thing to do is use the OID name, rather than the OID number in the generator config. This avoids typos like this.

modules:
  XPPC-MIB:
    walk:
      - upsThreePhaseOutputVoltageR



--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2d3d4933-6f2a-499c-a1ac-215ebb649de7n%40googlegroups.com.

sabarish narayanan

unread,
Sep 14, 2020, 3:37:45 AM9/14/20
to Prometheus Users
Thanks a ton. That worked. I had tried dropping the last 0 with the OID number and the OID name with the last 0. Both didn't work, but the OID name without the last 0 worked. Thanks you very much.

sabarish narayanan

unread,
Sep 14, 2020, 3:40:29 AM9/14/20
to Prometheus Users
Although, isn't that last 0 in the OID name or OID number the world standard? Shouldn't it work with the 0 as well?
Thanks in advance.

sabarish narayanan

unread,
Sep 14, 2020, 3:41:38 AM9/14/20
to Prometheus Users
Although, isn't that last 0 in the OID name or OID number the world standard? Shouldn't it work with the 0 as well?
Thanks in advance.


On Monday, 14 September 2020 at 12:51:41 UTC+5:30 sup...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages