Search code examples
csnmpnet-snmpmib

snmpwalk can't walk table with "accessible-for-notify" item


I have a MIB where 3 tables contain as first element items marked as "accessible-for-notify", like:

    -- 1.3.6.1.4.1.3979.7.4.3.2.2.1
    awOduChannelTable OBJECT-TYPE
        SYNTAX SEQUENCE OF AwOduChannelEntry
        MAX-ACCESS not-accessible
        STATUS current
        DESCRIPTION
            "Description."
        ::= { awOduChannels 1 }

    -- 1.3.6.1.4.1.3979.7.4.3.2.2.1.1
    awOduChannelEntry OBJECT-TYPE
        SYNTAX AwOduChannelEntry
        MAX-ACCESS accessible-for-notify
        STATUS current
        DESCRIPTION
            "Description."
        INDEX { awTopRadioIndex, awOduIndex, awOduChannelIndex }
        ::= { awOduChannelTable 1 }

If I try to query any of the remaining items individually (snmpget, snmpgetnext or snmpset), everything works, but when I try to snmpwalk or snmptable, I got an error stating "unknown column or not readable".

I tried changing to "not-accessible", but it changed nothing.

Why is net-snmp trying to iterate over "accessible-for-notify" items? What should I do to fix?


EDIT:

In my init_awOduChannelTable() function the items were being initialized this way:

tblnfo->min_column = 1;
tblnfo->max_column = 5;

I changed it to:

tblnfo->min_column = 2;
tblnfo->max_column = 5;

So now it skips the "accessible-for-notify" column, as suggested by @rbelli.

Thanks.


Solution

  • You can change your code to start in column 2 instead of column 1. You can change the value min_column in the struct netsnmp_table_registration_info to value 2. And if you need a more fine adjustment you can change the netsnmp_column_info *valid_columns; field and says column per column which is valid.