Find the answer to your Linux question:
Results 1 to 3 of 3
Greetings to all! I'm facing a problem regarding the SNMP Tables compilation and I wonder if there is anyone that has written a MIB with a table and successfully compiled ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Location
    Athens, Greece
    Posts
    7

    Unhappy SNMP Tables - Compiler Errors


    Greetings to all!

    I'm facing a problem regarding the SNMP Tables compilation and I wonder if there is anyone that has written a MIB with a table and successfully compiled the code.

    This is a brief description of my problem :
    - I have written a MIB that consists of two tables (the second table augmenting the first)
    - I have run the <mib2c -c mib2c.mfd.conf myFirstTable> command (myFirstTable is a mib table)
    - An the mib2c -c <mib2c.mfd.conf mySecondTable>
    - The above produces various source files for the tables, some sources for the subagent and a Makefile
    - Then I tried to run the Makefile and many errors occured. Examples :
    myFirstTable_data_access : myFirstTableFirstColumn undeclared
    myFirstTable_data_access : myFirstTableSecondColumn undeclared
    and so on and so forth
    - Even though i did not touch the source files and left them as they where generated by the mib2c, the data_access.c file seems to consider as "undeclared" all my columns.

    Do you have any thoughts on what should I do to solve the above an produce an executable?

    (Please note that this is my first time trying to compile an SNMP table and I must say that it is much more different and difficult than compiling more simple MIBs with scalar OIDs... I have read all the tutorials I could find and the README files produced by the mib2c, but I cannot understand a thing!)

    I would greatly and deeply appreciate any insight on the matter and any advice on what should I do to compile the subagents and move on with my life.

    Thank you all, in advance

  2. #2
    Just Joined!
    Join Date
    Feb 2012
    Location
    Athens, Greece
    Posts
    7
    Update.
    I solved the above problem. It seemed that the Generated Codes where using some variables that they did not declare first.
    So, all I did was to declare them and set their values (example : int myFirstTableFirstColumn = 0; )

    Now I'm facing another problem.
    I compiled the subagent, successfully, and ran it.
    And although it seems to be running and not having any trouble registering my table, I cannot get any data from him.
    Commands such as "snmptable", "snmpwalk" and "snmpget" always result in the following error :
    myFirstTable: Unknown Object Identifier (Sub-id not found: (top) -> myFirstTable)

    Does anyone have any idea why is this happening..?

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Location
    Athens, Greece
    Posts
    7
    Once again, problem solved.
    In case anyone else is having the same error here is some explanation:
    The snmpwalk is a call to many snmpget. BUT, my Table was empty. Which means that it didn't have any OIDs to fetch. That's why it returned the "Unknown Object Identifier"
    Think of the snmpwalk as a "myFirstTableFirstColumn.1" where "1" is the first row of the table.
    The row is not existant, so the "myFirstTableFirstColumn.1" results to "unknown OID"

    This is the explanation I gave to the problem. I can't be sure if my theory is correct.
    Plus, by adding a row in my table, both snmpwalk and snmpget returned values with no errors.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •