Re :Re: How can I set contextName instead of default NULL

"girish" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <1199451376.S.5168.32428.webmail77.rediffmail.com.old.1199521365.9350@webmail.rediffmail.com>
I've modified snmpd.conf and now contextName thing is working fine for scalars. How ever when I give same lines in the tables&nbsp; its giving segmentation fault problem. The trace and the code is as below:reg =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_create_handler_registration("MylTable",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyTable_handler,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
 bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyTable_oid,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
 ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyTable_oid_len,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HANDLER_CAN_RWRITE);&nbsp;&nbsp;&nbsp; reg-&gt;contextName = strdup("mycontext");&nbsp;&nbsp;&nbsp; netsnmp_register_handler(reg);the seg fault back trace is: #0&nbsp; 0xb772c36b in strlen () from /lib/libc.so.6#1&nbsp; 0xb772c0d5 in strdup () from /lib/libc.so.6#2&nbsp; 0xb79fa0f3 in agentx_register () from /usr/lib/libnetsnmpagent.so.15#3&nbsp; 0xb79e8af1 in agentx_registration_callback () from /usr/lib
 /libnetsnmpagent.so.15#4&nbsp; 0xb795a727 in snmp_call_callbacks () from /usr/lib/libnetsnmp.so.15#5&nbsp; 0xb79dd1e0 in register_mib_reattach_node () from /usr/lib/libnetsnmpagent.so.15#6&n
 bsp; 0xb79dd22f in register_mib_reattach () from /usr/lib/libnetsnmpagent.so.15#7&nbsp; 0xb79e96ca in agentx_reopen_session () from /usr/lib/libnetsnmpagent.so.15#8&nbsp; 0xb79e6ca3 in subagent_startup () from /usr/lib/libnetsnmpagent.so.15#9&nbsp; 0xb795a727 in snmp_call_callbacks () from /usr/lib/libnetsnmp.so.15#10 0xb794dfff in read_configs () from /usr/lib/libnetsnmp.so.15#11 0xb792b118 in init_snmp () from /usr/lib/libnetsnmp.so.15#12 0x082b6aac in snmpsubagent () at /root/home/snmp/src/SnmpInit.cc:407#13 0xb7ba8001 in ?? () from /lib/libpthread.so.0#14 0x00000000 in ?? ()For tables do I have to do anything different?On Fri, 4 Jan 2008 12:46:30 +0000 "Dave Shield"  wrote  On 4 Jan 2008 12:35:06 -0000, girish  wrote:  &gt; Well here is the snmpd.conf file which I 've configured    Ju
 st concentrating the access control settings,  you have:    &gt; rwuser myuser  &gt; rwuser myuser  &gt; rwuser myuser  &gt; rwuser myuser    i.e. four copies of the same entry!  plus:    &g
 t; access mygroup "mycontext" authNoPriv myuser    which is not the correct syntax for the "access" directive.    Please re-read the documentation for access control,  either in snmpd.conf(5) or the FAQ entry     I don't understand the new access control stuff - what does it mean?          http://www.net-snmp.org/wiki/index.php/FAQ:Agent_24    If you don't configure things correctly, then no - it won't work.    Dave    -------------------------------------------------------------------------  This SF.net email is sponsored by: Microsoft  Defy all challenges. Microsoft(R) Visual Studio 2005.  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/  _______________________________________________  Net-snmp-users mailing list  [email protected]  Please see the following pa
 ge to unsubscribe or change other options:  https://lists.sourceforge.net/lists/listinfo/net-snmp-users    


Regards,
Girish

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.