begeekmyfriend / smithsnmp

SNMP agent for monitoring
GNU General Public License v2.0
31 stars 17 forks source link

Help for OID numbering #4

Closed ghost closed 3 years ago

ghost commented 5 years ago

Hi all, while playing around with a concrete request for an own MIB I ran into following problem:

In agentx mode I want to create an OID numbering like below:

iso.3.6.1.4.1.9999.4.2.5.1.1 = STRING: "Test value 1" iso.3.6.1.4.1.9999.4.2.5.1.2 = STRING: "Test value 2" iso.3.6.1.4.1.9999.4.2.5.1.3 = STRING: "Test value 3" iso.3.6.1.4.1.9999.4.2.5.1.4 = STRING: "Test value 4" iso.3.6.1.4.1.9999.4.2.5.1.5 = STRING: "Test value 5" iso.3.6.1.4.1.9999.4.2.5.2.1 = STRING: "1" iso.3.6.1.4.1.9999.4.2.5.2.2 = STRING: "2" iso.3.6.1.4.1.9999.4.2.5.2.3 = STRING: "3" iso.3.6.1.4.1.9999.4.2.5.2.4 = STRING: "4" iso.3.6.1.4.1.9999.4.2.5.2.5 = STRING: "5"

but with smithsnmpd I only succeed in generating OIDs in the following form:

so.3.6.1.4.1.9999.4.2.5.1.1.1 = STRING: "Test value 1" iso.3.6.1.4.1.9999.4.2.5.1.2.1 = STRING: "Test value 2" iso.3.6.1.4.1.9999.4.2.5.1.3.1 = STRING: "Test value 3" ...

What I mean is the last sub OID always results in 1 into difference to the first example. Any idea how this can be solved?

I think the problem is within the table structure which always MUST have the form

[1] = {
    [1] = {
        indexes = entry_cache,
        [1] = mib.ConstOctString(function (i) return entry_get(i, 'line_state_detail') 
                }
            }

Any help would be aprreciated.

begeekmyfriend commented 5 years ago

Please refer the doc on Chapter Data indexes

ghost commented 5 years ago

Hi beegeekmyfriend,

thank you for your answer but sorry, I think I didn't get the clue.

If I have a look at the example udp lua or at the two_cascaded_index_table.lua I think these examples would result in an oid [udpTable].[1].[1] ... (udp) respectively [1].[1].[TwoIndexTableIdxA] ... (cascaded_index_table).

In my agentx.conf I have registered my mib at 1.3.6.1.4.9999.4.2.5 and I would like to have sub-oid's (e.g) 1.3.6.1.4.9999.4.2.5.1.1, 1.3.6.1.4.9999.4.2.5.1.2 or 1.3.6.1.4.9999.4.2.5.2.1 BUT NOT 1.3.6.1.4.9999.4.2.5.1.1.1 / 1.3.6.1.4.9999.4.2.5.1.2.1 or 1.3.6.1.4.9999.4.2.5.2.1.1

Do you have another hint for me? Thanks in advance

begeekmyfriend commented 5 years ago

You can print the whole content of entry_cache in load_config function and see what they are.