OK.

At first glance, I see you're trying to walk OID "ldskHasFailedSet", but 
that's not a table, that's a NOTIFICATION-TYPE object. Presumably this is 
an OID which would be used in a trap message, not an OID that you can poll 
using get/getbulk.  Therefore, I think even if you get the generator to 
work, it's not going to do anything useful.

However, the problem you have appears to be down to how you're running the 
generator and the mib files you're providing (or not providing). Since the 
generator uses net-snmp to parse the files, you can get a more detailed 
error if you run the "snmptranslate" command.

e.g. suppose you have the mib file in a subdirectory called "mibs" within 
the current directory (but no other mibs are in that directory), and you 
run the following command:

$ MIBDIRS=mibs MIBS=: snmptranslate -On ThreeParMIB::ldskHasFailedSet
No log handling enabled - using stderr logging
MIB search path: mibs
Cannot find module (SNMPv2-TC): At line 74 in mibs/ThreeParMIB.mib
Cannot find module (SNMPv2-SMI): At line 79 in mibs/ThreeParMIB.mib
Module not found (SNMPv2-MIB): At line 236 in mibs/ThreeParMIB.mib
Module not found (SNMPv2-MIB): At line 251 in mibs/ThreeParMIB.mib
Did not find 'DisplayString' in module #-1 (mibs/ThreeParMIB.mib)
Did not find 'enterprises' in module #-1 (mibs/ThreeParMIB.mib)
Unlinked OID in ThreeParMIB: threepar ::= { enterprises 12925 }
Undefined identifier: enterprises near line 81 of mibs/ThreeParMIB.mib
ThreeParMIB::ldskHasFailedSet: Unknown Object Identifier

You can see all the other mib files it's referring to, and failing to find.

Next, suppose you have a checkout of the snmp_exporter git repository, and 
you are in the "generator" subdirectory. Now you type "make generate" which 
fetches all the dependent mibs. After doing this, you copy the 
TreeParMIB.mib file into the mibs subdirectory in addition to those already 
there.

Now we see:

$ MIBDIRS=mibs MIBS=: snmptranslate -On ThreeParMIB::ldskHasFailedSet
.1.3.6.1.4.1.12925.1.2.0.21

Successful.  (I strongly recommend you use the mibs downloaded by "make 
generate", not any mibs you happen to have lying around on your system; 
those are often broken).

Now you can run the generator, replacing generator.yml with the one you 
supplied:

$ MIBDIRS=mibs ~/go/bin/generator generate
ts=2023-04-14T14:02:32.239Z caller=net_snmp.go:161 level=info msg="Loading 
MIBs" from=mibs
ts=2023-04-14T14:02:32.660Z caller=main.go:119 level=warn msg="NetSNMP 
reported parse error(s)" errors=2
ts=2023-04-14T14:02:32.739Z caller=main.go:51 level=info msg="Generating 
config for module" module=HPE_3PAR
ts=2023-04-14T14:02:32.762Z caller=main.go:66 level=info msg="Generated 
metrics" module=HPE_3PAR metrics=0
ts=2023-04-14T14:02:32.764Z caller=main.go:91 level=info msg="Config 
written" file=/Users/brian/git/snmp_exporter/generator/snmp.yml

This has successfully generated an snmp.yml:

$ cat snmp.yml
# WARNING: This file was auto-generated using snmp_exporter generator, 
manual changes will be lost.
HPE_3PAR:
  walk:
  - 1.3.6.1.4.1.12925.1.2.0.21
  metrics: []

Don't worry about the "errors=2".  I can see that "make generate" also says 
there are 2 errors; this must be some other issue in the set of MIBs.

Anyway: that's how you run the generator to create snmp.yml.  But in order 
to get useful results, you'll have to select an OID tree that's actually 
walkable.

On Friday, 14 April 2023 at 13:35:11 UTC+1 Monica wrote:

> Hello Brian,
>
> No it's not confidential, same is available for public download. PFA MIB 
> file FYR.
>
> On Friday, April 14, 2023 at 5:55:02 PM UTC+5:30 Brian Candler wrote:
>
>> No, it doesn't work like that: see 
>> http://www.eyrie.org/~eagle/faqs/questions.html and 
>> http://www.catb.org/~esr/faqs/smart-questions.html#noprivate
>>
>> If the MIB files you're using are available for public download, and you 
>> want us to help you, then please post the URLs of the files you are using 
>> publicly.
>>
>> If you have the MIB files under some sort of private arrangement or 
>> non-disclosure agreement, then please say so and we'll understand. We won't 
>> be able to help you in this forum, but you could look at getting paid 
>> support from one of various orgs which provide Prometheus consultancy.
>>
>> On Friday, 14 April 2023 at 13:05:58 UTC+1 Monica wrote:
>>
>>> Hi Brian,
>>>
>>> Thank you for the update. could you pls share your email ID, will share 
>>> the exact MIB file to you.
>>>
>>> Thanks in advance!!
>>>
>>> On Friday, April 14, 2023 at 12:39:15 PM UTC+5:30 Brian Candler wrote:
>>>
>>>> Unless you show exactly which MIB files you're using and where to 
>>>> obtain them (the exact download URLs), all I can really say is "there's a 
>>>> problem with your MIB files".
>>>>
>>>> The error suggests you're loading a MIB file contains a reference to 
>>>> "storeServAlertsGroup" which should be in some other MIB file, but you're 
>>>> missing that other MIB file.  Or else there's an error in the MIB file 
>>>> (broken MIB files are not that uncommon, unfortunately).
>>>>
>>>> On Friday, 14 April 2023 at 04:29:14 UTC+1 Monica wrote:
>>>>
>>>>> Hi,
>>>>> Pls reply
>>>>>
>>>>>
>>>>> On Wednesday, April 12, 2023 at 1:56:49 PM UTC+5:30 Monica wrote:
>>>>>
>>>>>> Hi Brian,
>>>>>>
>>>>>> Thank you so much for the update. I have copied the entire folder 
>>>>>> from one of my prod servers and the OS version and other dependencies 
>>>>>> are 
>>>>>> also same. However, the issue still persists.
>>>>>> Could you pls help me on this. 
>>>>>>
>>>>>>
>>>>>> On Tuesday, April 11, 2023 at 8:46:06 PM UTC+5:30 Brian Candler wrote:
>>>>>>
>>>>>> It looks like you're missing some MIB files. It's quite common for 
>>>>>> some MIB files to depend on other MIB files, so you need to fetch the 
>>>>>> dependencies too.
>>>>>>
>>>>>> On Tuesday, 11 April 2023 at 15:53:42 UTC+1 Monica wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am trying to generate snmp.yml by using the generator binary. Below 
>>>>>> is the sample of my generator file :-
>>>>>>
>>>>>> modules:
>>>>>>   HPE_3PAR:
>>>>>>     walk:
>>>>>>       - ldskHasFailedSet
>>>>>>
>>>>>> While generating the same I am getting below error, however 
>>>>>> snmptranslate is working fine for the same-:
>>>>>>
>>>>>> level=info ts=2023-04-10T19:15:14.879Z caller=net_snmp.go:142 
>>>>>> msg="Loading MIBs" from=mibs
>>>>>> level=warn ts=2023-04-10T19:15:14.883Z caller=main.go:120 
>>>>>> msg="NetSNMP reported parse error(s)" errors=595
>>>>>> level=info ts=2023-04-10T19:15:14.883Z caller=main.go:52 
>>>>>> msg="Generating config for module" module=HPE_3PAR
>>>>>> level=error ts=2023-04-10T19:15:14.884Z caller=main.go:130 msg="Error 
>>>>>> generating config netsnmp" err="cannot find oid 'storeServAlertsGroup' 
>>>>>> to 
>>>>>> walk"
>>>>>>
>>>>>>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/7c813aa5-262b-4ff9-aa2d-e8a670a5c475n%40googlegroups.com.

Reply via email to