FYI, I just checked in a change to the generator that makes missing MIB
files a lot more obvious.

https://github.com/prometheus/snmp_exporter/pull/1167

If you pull latest main and build the generator it will try and tell you
exactly which MIB modules are missing from the mibs directories.

We're going to cut a new release soon with this functionality as well.

On Mon, May 6, 2024 at 6:27 PM Mehran Saeed <[email protected]> wrote:

> Hello Alex
> Thanks for looking into it. I really appreciate that.
>
> I am able to generate the oids now. I wasn't aware that I need to make
> sure of this file as well "A10-COMMON-MIB.txt" which is the root file
>
> Thanks again
>
> On Sat, May 4, 2024 at 9:13 PM Alexander Wilke <[email protected]>
> wrote:
>
>> Needed Mibs:
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10# ls -la
>> insgesamt 272
>> drwxr-xr-x 2 root root     91  4. Mai 22:07 .
>> drwxrwxr-x 8 root root    332  4. Mai 22:07 ..
>>
>> *-rw-r--r-- 1 root root 261898 15. Jun 2022  A10-AX-MIB.mib-rw-r--r-- 1
>> root root   4572 15. Jun 2022  A10-COMMON-MIB.mib*
>> -rwxr-xr-x 1 root root    369  4. Mai 22:06 generator.yml
>> -rw-r--r-- 1 root root   3518  4. Mai 22:07 snmp.yml
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10#
>>
>>
>> generator.yml:
>>
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10# cat
>> ./generator.yml
>> auths:
>>   public_v1:
>>     version: 1
>>   public_v2:
>>     version: 2
>>   a10_device:
>>     version: 3
>>     username: Some
>>     password: TotallySecret
>>     auth_protocol: SHA
>>     priv_protocol: AES
>>     priv_password: SomeOtherSecret
>>     security_level: authPriv
>>
>> modules:
>>   # A10
>>   a10_mibs:
>>     walk: [axSysMemory,axSysCpu]
>>     max_repetitions: 100
>>     timeout: 30s
>>     retries: 0
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10#
>>
>>
>> generate command pointing o the default mibs in "mibs" folder and the
>> additional mibs in "mibs_a10" folder:
>>
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator# ./generator
>> generate -m /opt/prometheus/snmp_exporter/generator/mibs/ -m
>> /opt/prometheus/snmp_exporter/generator/mibs_a10/ -g
>> /opt/prometheus/snmp_exporter/generator/mibs_a10/generator.yml -o
>> /opt/prometheus/snmp_exporter/generator/mibs_a10/snmp.yml
>> ts=2024-05-04T20:07:04.764Z caller=net_snmp.go:175 level=info
>> msg="Loading MIBs"
>> from=/opt/prometheus/snmp_exporter/generator/mibs/:/opt/prometheus/snmp_exporter/generator/mibs_a10/
>> ts=2024-05-04T20:07:06.035Z caller=main.go:53 level=info msg="Generating
>> config for module" module=a10_mibs
>> ts=2024-05-04T20:07:06.138Z caller=main.go:68 level=info msg="Generated
>> metrics" module=a10_mibs metrics=12
>> ts=2024-05-04T20:07:06.141Z caller=main.go:93 level=info msg="Config
>> written" file=/opt/prometheus/snmp_exporter/generator/mibs_a10/snmp.yml
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator#
>>
>>
>> result snmp.yml:
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10# cat
>> snmp.yml
>> # WARNING: This file was auto-generated using snmp_exporter generator,
>> manual changes will be lost.
>> auths:
>>   a10_device:
>>     community: public
>>     security_level: authPriv
>>     username: Some
>>     password: TotallySecret
>>     auth_protocol: SHA
>>     priv_protocol: AES
>>     priv_password: SomeOtherSecret
>>     version: 3
>>   public_v1:
>>     community: public
>>     security_level: noAuthNoPriv
>>     auth_protocol: MD5
>>     priv_protocol: DES
>>     version: 1
>>   public_v2:
>>     community: public
>>     security_level: noAuthNoPriv
>>     auth_protocol: MD5
>>     priv_protocol: DES
>>     version: 2
>> modules:
>>   a10_mibs:
>>     walk:
>>     - 1.3.6.1.4.1.22610.2.4.1.2
>>     - 1.3.6.1.4.1.22610.2.4.1.3
>>     metrics:
>>     - name: axSysMemoryTotal
>>       oid: 1.3.6.1.4.1.22610.2.4.1.2.1
>>       type: gauge
>>       help: The total memory(KB). - 1.3.6.1.4.1.22610.2.4.1.2.1
>>     - name: axSysMemoryUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.2.2
>>       type: gauge
>>       help: The usage memory(KB). - 1.3.6.1.4.1.22610.2.4.1.2.2
>>     - name: axSysCpuNumber
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.1
>>       type: gauge
>>       help: The cpu number in a10System - 1.3.6.1.4.1.22610.2.4.1.3.1
>>     - name: axSysCpuIndex
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.2.1.1
>>       type: gauge
>>       help: The index of the CPU. - 1.3.6.1.4.1.22610.2.4.1.3.2.1.1
>>       indexes:
>>       - labelname: axSysCpuIndex
>>         type: gauge
>>     - name: axSysCpuUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.2.1.2
>>       type: DisplayString
>>       help: The CPU Usage. - 1.3.6.1.4.1.22610.2.4.1.3.2.1.2
>>       indexes:
>>       - labelname: axSysCpuIndex
>>         type: gauge
>>     - name: axSysCpuUsageValue
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.2.1.3
>>       type: gauge
>>       help: The CPU usage value. - 1.3.6.1.4.1.22610.2.4.1.3.2.1.3
>>       indexes:
>>       - labelname: axSysCpuIndex
>>         type: gauge
>>     - name: axSysAverageCpuUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.3
>>       type: gauge
>>       help: The average CPU usage in last 5 seconds. -
>> 1.3.6.1.4.1.22610.2.4.1.3.3
>>     - name: axSysAverageControlCpuUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.4
>>       type: gauge
>>       help: The average control CPU usage in last 5 seconds. -
>> 1.3.6.1.4.1.22610.2.4.1.3.4
>>     - name: axSysAverageDataCpuUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.5
>>       type: gauge
>>       help: The average data CPU usage in last 5 seconds. -
>> 1.3.6.1.4.1.22610.2.4.1.3.5
>>     - name: axSysCpuIndexInUsage
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.6.1.1
>>       type: gauge
>>       help: The index of the CPU - 1.3.6.1.4.1.22610.2.4.1.3.6.1.1
>>       indexes:
>>       - labelname: axSysCpuIndexInUsage
>>         type: gauge
>>       - labelname: axSysCpuUsagePeriodIndex
>>         type: gauge
>>     - name: axSysCpuUsagePeriodIndex
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.6.1.2
>>       type: gauge
>>       help: 'The CPU usage sampling period: 1: 1-second sampling, 2:
>> 5-second sampling,
>>         3: 10-second sampling, 4: 30-second sampling, 5: 60-second
>> sampling. - 1.3.6.1.4.1.22610.2.4.1.3.6.1.2'
>>       indexes:
>>       - labelname: axSysCpuIndexInUsage
>>         type: gauge
>>       - labelname: axSysCpuUsagePeriodIndex
>>         type: gauge
>>     - name: axSysCpuUsageValueAtPeriod
>>       oid: 1.3.6.1.4.1.22610.2.4.1.3.6.1.3
>>       type: gauge
>>       help: The CPU usage value at given period, 1-sec, 5-sec, 10-sec,
>> 30-sec, and
>>         60-sec. - 1.3.6.1.4.1.22610.2.4.1.3.6.1.3
>>       indexes:
>>       - labelname: axSysCpuIndexInUsage
>>         type: gauge
>>       - labelname: axSysCpuUsagePeriodIndex
>>         type: gauge
>>     max_repetitions: 100
>>     retries: 0
>>     timeout: 30s
>> root@ubiquiti:/opt/prometheus/snmp_exporter/generator/mibs_a10#
>>
>>
>> Mehran Saeed schrieb am Samstag, 4. Mai 2024 um 11:13:09 UTC+2:
>>
>>> yeah tried without oids but still the same result.
>>>
>>> just to double check.
>>> The correct way is to clone the generator repo, add the custom mib to
>>> the mibs dir and run the make generate cmd to generate the executable
>>> generator file and then run ./generator generate to run the generator.
>>>
>>> not sure what I am doing wrong here.
>>>
>>>
>>> On Fri, May 3, 2024 at 6:45 PM Alexander Wilke <[email protected]>
>>> wrote:
>>>
>>>> Try this instead of oid
>>>> axSysMemory
>>>> axSysCpu
>>>>
>>>>
>>>>
>>>>
>>>> Mehran Saeed schrieb am Mittwoch, 1. Mai 2024 um 12:42:06 UTC+2:
>>>>
>>>>> Just wondering if this format correct for the generator.yml as in is
>>>>> this how mibs or defined
>>>>>
>>>>> auths:
>>>>>   public_v1:
>>>>>     version: 1
>>>>>   public_v2:
>>>>>     version: 2
>>>>>
>>>>>
>>>>>   prometheus_v3:
>>>>>     username: user
>>>>>     password: pwd
>>>>>     auth_protocol: SHA
>>>>>     priv_protocol: AES
>>>>>     security_level: authPriv
>>>>>     priv_password: pwd
>>>>>     version: 3
>>>>>
>>>>> modules:
>>>>>
>>>>>   a10:
>>>>>     walk:
>>>>>       - 1.3.6.1.4.1.22610.2.4.1.2.1
>>>>>
>>>>>
>>>>> before running the  ./generator generate \ cmd I did make generate as
>>>>> well to create the generator execution file.
>>>>> getting the same error no matter what I change.
>>>>> On Monday, April 29, 2024 at 8:18:19 AM UTC+1 Mehran Saeed wrote:
>>>>>
>>>>>> Yes correct thats the one
>>>>>>
>>>>>> On Sun, Apr 28, 2024 at 5:43 PM Alexander Wilke <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Is this MIB in the MIBs folder?
>>>>>>> https://www.circitor.fr/Mibs/Mib/A/A10-AX-MIB.mib
>>>>>>>
>>>>>>> Mehran Saeed schrieb am Samstag, 27. April 2024 um 21:08:54 UTC+2:
>>>>>>>
>>>>>>>> Thanks for responding.
>>>>>>>>
>>>>>>>> below are the two MIBs for memory I am trying to use:
>>>>>>>>
>>>>>>>> memory usage: 1.3.6.1.4.1.22610.2.4.1.2.2
>>>>>>>>
>>>>>>>> Field Name : axSysMemoryUsage
>>>>>>>> Field Type: Integer32
>>>>>>>> Field Status : current
>>>>>>>> Description : The usage memory(KB).
>>>>>>>> OID : 1.3.6.1.4.1.22610.2.4.1.2.2
>>>>>>>>
>>>>>>>> memory total: 1.3.6.1.4.1.22610.2.4.1.2.1
>>>>>>>>
>>>>>>>>   Field Name : axSysMemoryTotal
>>>>>>>> Field Type: Integer32
>>>>>>>> Field Status : current
>>>>>>>> Description : The total memory(KB).
>>>>>>>> OID : 1.3.6.1.4.1.22610.2.4.1.2.1
>>>>>>>>
>>>>>>>>
>>>>>>>> I used the cmd below to get the generator executable file:
>>>>>>>>
>>>>>>>> make generate
>>>>>>>>
>>>>>>>> then to run the generator ran this cmd:
>>>>>>>>
>>>>>>>> ./generator generate   -m /snmp_exporter/generator/mibs  -g
>>>>>>>> /generator/generator.yml   -o /snmp_exporter/mib/snmp.yml
>>>>>>>>
>>>>>>>>
>>>>>>>> I tried changing the generator.yml file by mentioning just object
>>>>>>>> id and OID but no luck
>>>>>>>>
>>>>>>>> ---
>>>>>>>> auths:
>>>>>>>>   public_v1:
>>>>>>>>     version: 1
>>>>>>>>   public_v2:
>>>>>>>>     version: 2
>>>>>>>>
>>>>>>>>
>>>>>>>>   prometheus_v3:
>>>>>>>>     username: user
>>>>>>>>     password: pwd
>>>>>>>>     auth_protocol: SHA
>>>>>>>>     priv_protocol: AES
>>>>>>>>     security_level: authPriv
>>>>>>>>     priv_password: pwd
>>>>>>>>     version: 3
>>>>>>>>
>>>>>>>> modules:
>>>>>>>>
>>>>>>>>   a10:
>>>>>>>>     walk:
>>>>>>>>       - 1.3.6.1.4.1.22610.2.4.1.2.1
>>>>>>>>
>>>>>>>>
>>>>>>>> On Saturday, April 27, 2024 at 7:22:32 PM UTC+1 Alexander Wilke
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> You probably do not have alle required mibs in the folder.
>>>>>>>>> Please Post the MIBs which you want to use and the generator
>>>>>>>>> command you used.
>>>>>>>>>
>>>>>>>>> PS:
>>>>>>>>> On top of all MIBs there are comments Like IMPORT which describes
>>>>>>>>> which other MIBs are needed.
>>>>>>>>> Fürther use MIBv2 with names instead OIDs. Put the Name in the
>>>>>>>>> Generator yml Not the oid.
>>>>>>>>>
>>>>>>>>> Mehran Saeed schrieb am Samstag, 27. April 2024 um 19:38:49 UTC+2:
>>>>>>>>>
>>>>>>>>>> yes sure
>>>>>>>>>> below are the logs whilst generating
>>>>>>>>>>
>>>>>>>>>> ```
>>>>>>>>>> MIBDIRS='mibs' ./generator --fail-on-parse-errors generate
>>>>>>>>>> ts=2024-04-27T17:34:02.776Z caller=net_snmp.go:175 level=info
>>>>>>>>>> msg="Loading MIBs" from=mibs
>>>>>>>>>> ts=2024-04-27T17:34:03.011Z caller=main.go:124 level=warn
>>>>>>>>>> msg="NetSNMP reported parse error(s)" errors=3839
>>>>>>>>>> ts=2024-04-27T17:34:03.094Z caller=main.go:53 level=info
>>>>>>>>>> msg="Generating config for module" module=a10
>>>>>>>>>> ts=2024-04-27T17:34:03.115Z caller=main.go:134 level=error
>>>>>>>>>> msg="Error generating config netsnmp" err="cannot find oid
>>>>>>>>>> 'axSysSecondaryVersionOnDisk' to walk
>>>>>>>>>> ```
>>>>>>>>>>
>>>>>>>>>> Also if I try generating the if-mib objects from if-mib module
>>>>>>>>>> they work fine.
>>>>>>>>>> I need to generate mibs for A10. have put the a10 mib file in the
>>>>>>>>>> mibs directory.
>>>>>>>>>> Looks like its not able to find the OIDs for a10.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Apr 27, 2024 at 10:38 AM Ben Kochie <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Can you post the logs of the `generator generate`? What about 
>>>>>>>>>>> `generator
>>>>>>>>>>> parse_errors`?
>>>>>>>>>>>
>>>>>>>>>>> On Sat, Apr 27, 2024 at 11:37 AM Mehran Saeed <
>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>> Hello
>>>>>>>>>>>> I am trying to generate snmp.yml from generator but it fails.
>>>>>>>>>>>> its for a10 load balancers as I needed extra mibs for CPU and 
>>>>>>>>>>>> memory. below
>>>>>>>>>>>> is the generator.yml config.
>>>>>>>>>>>> I have added the mib file into the correct mib directory as
>>>>>>>>>>>> well.
>>>>>>>>>>>>
>>>>>>>>>>>> ```
>>>>>>>>>>>> ---
>>>>>>>>>>>> auths:
>>>>>>>>>>>>   public_v1:
>>>>>>>>>>>>     version: 1
>>>>>>>>>>>>   public_v2:
>>>>>>>>>>>>     version: 2
>>>>>>>>>>>>
>>>>>>>>>>>>   prometheus_v3:
>>>>>>>>>>>>     username: user
>>>>>>>>>>>>     password: pwd
>>>>>>>>>>>>     auth_protocol: SHA
>>>>>>>>>>>>     priv_protocol: AES
>>>>>>>>>>>>     security_level: authPriv
>>>>>>>>>>>>     priv_password: pwd
>>>>>>>>>>>>     version: 3
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> modules:
>>>>>>>>>>>>   # Default IF-MIB interfaces table with ifIndex.
>>>>>>>>>>>>   a10:
>>>>>>>>>>>>     walk:
>>>>>>>>>>>>       - 1.22610.2.4.1.2.2
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> 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 [email protected].
>>>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>>>> https://groups.google.com/d/msgid/prometheus-users/3255afc8-e4cd-4260-b405-bf13047cd53fn%40googlegroups.com
>>>>>>>>>>>> <https://groups.google.com/d/msgid/prometheus-users/3255afc8-e4cd-4260-b405-bf13047cd53fn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>>> .
>>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>> 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 [email protected].
>>>>>>>
>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/prometheus-users/05d6da1d-c5a7-47b4-9dcf-670d3ffc330cn%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/prometheus-users/05d6da1d-c5a7-47b4-9dcf-670d3ffc330cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>> 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 [email protected].
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/prometheus-users/ebf6ef43-edbb-42f8-bb62-b956f008bbd9n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/prometheus-users/ebf6ef43-edbb-42f8-bb62-b956f008bbd9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-users/0c840f86-de03-4fca-a249-19b92c1cf6d5n%40googlegroups.com
>> <https://groups.google.com/d/msgid/prometheus-users/0c840f86-de03-4fca-a249-19b92c1cf6d5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAACWPeqnfJY%2BLyrjACg%2Bxsf4w-J4BKWcmgFOUjhkRkC4zrEQAw%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAACWPeqnfJY%2BLyrjACg%2Bxsf4w-J4BKWcmgFOUjhkRkC4zrEQAw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CABbyFmojnQGiTE0LZTLnvsRc7rnn92p9depYH-Cwqt39AW-bWw%40mail.gmail.com.

Reply via email to