Re: how to Initialise the contents of the table?
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 12/08/06, 蔷<Qiang Hu> <[email protected]> wrote: > i created an entry as you told me.but snmpd got a segment fault when i > snmpget or snmpset Right - then you need to determine exactly *where* this fault is occuring, and what is triggering it. Try running the agent under a debugger, starting it with "-f -Le", and then query it as before. When the agent falls over, look at a back-trace of exactly where it had got to, and the code on (and around) the line that caused the fault. If you can identify exactly what triggered the crash, that's the first step towards fixing it. > 1,whether the routine tbModuleTable_createEntry need to modify?in my > opinion,if not, it coundn't create an entry in function,because what i did > as you told me is just to fill the contents of the table,but if there is no > row of the table,i think filling makes no sense.is it right? I'm sorry - I don't understand what you are asking here. The purpose of this routine is to create a new row in the table. Looking at your code, it's possible that you might need to set values for the tbModuleID and tbModuleDescription fields. Is that what you mean? > i saw the \agent\mibgroup\disman\event\mtEventTable.c~``it > uses the APIs netsnmp_tdata_create_row and > netsnmp_table_row_add_index, That's because it uses a different helper. This module is built using the 'table_tdata' helper rather than the 'table_iterator' helper, so it has a different structure. Don't try to merge different model together, unless you're really sure you know what you are doing. Much better to stick with one approach, and get that working. > 2,if i initial the contents of the table in the function > "initialize_table_tbModuleTable", whether i should definit > a static variable "entry" in > "initialize_table_tbModuleTable" as the return of the > routine tbModuleTable_createEntry. The 'entry' variable doesn't need to be static, since it's only used within a single routine. But yes, you do need to declare a variable of this name within the initialize routine, if that's where you are setting up the initial contents of the table. But I'm slightly confused - you said that you've already got the module compiled and linked into the agent. Surely you'll need this variable defined, in order to get the code to compile in the first place? > why there is no > document about how to modify the codes generated by mib2c.iterator.conf ?i > saw the document called "agent" for mib2c by old api configuration. Funny you should ask that. I'm sort-of in the middle of writing a book to cover exactly this sort of question. However, I've recently got sucked back into answering questions on the mailing list, and this has eaten away at the time that would be otherwise spent on the book. At some point, I'll need to drop out again, to blitz the book again, and get the thing finished! Unfortunately, you can't have both - either I'm helping people with problems now, or I'm providing documentation to help them in the future. Either way, somebody loses. Dave ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users