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

This is a discussion on Re :Re: How can I set contextName instead of default NULL within the SNMP Users forums, part of the Networking and Network Related category; --===============1815014904== Content-Type: multipart/alternative; boundary="=_b4dd795d00e9741a0151af7ffc94693d" --=_b4dd795d00e9741a0151af7ffc94693d Content-Type: text/plain; charset="ISO-8859-1" ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008
girish
 
Posts: n/a
Default Re :Re: How can I set contextName instead of default NULL

--===============1815014904==
Content-Type: multipart/alternative;
boundary="=_b4dd795d00e9741a0151af7ffc94693d"

--=_b4dd795d00e9741a0151af7ffc94693d
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

I've modified snmpd.conf and now contextName thing is working fine for scalars. How ever when I give same lines in the tables  its giving segmentation fault problem. The trace and the code is as below:reg =        netsnmp_create_handler_registration("MylTable",&nb sp;       &nbsp ;        & nbsp;       &nb sp;       &nbsp ;        & nbsp; MyTable_handler,     &nbs p;                 &n bsp;       &nbs p;              MyTable_oid,      &n bsp;       &nbs p;         &nbsp
;        & nbsp;       &nb sp;   MyTable_oid_len,     &nbs p;                 &n bsp;       &nbs p;              HANDLER_CAN_RWRITE);    reg->contextName = strdup("mycontext");    netsnmp_register_handler(reg);the seg fault back trace is: #0  0xb772c36b in strlen () from /lib/libc.so.6#1  0xb772c0d5 in strdup () from /lib/libc.so.6#2  0xb79fa0f3 in agentx_register () from /usr/lib/libnetsnmpagent.so.15#3  0xb79e8af1 in agentx_registration_callback () from /usr/lib/libnetsnmpagent.so.15#4  0xb795a727 in snmp_call_callbacks () from /usr/lib/libnetsnmp.so.15#5  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  0xb79e96ca in agentx_reopen_session () from /usr/lib/libnetsnmpagent.so.15#8  0xb79e6ca3 in subagent_startup () from /usr/lib/libnetsnmpagent.so.15#9  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: > Well here is the snmpd.conf file which I 've configured Just concentrating the access control settings, you have: > rwuser myuser > rwuser myuser > rwuser myuser > 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 Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/...net-snmp-users


Regards,
Girish
--=_b4dd795d00e9741a0151af7ffc94693d
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

I've modified snmpd.conf and now contextName thing is working fine for scal=
ars. How ever when I give same lines in the tables  its giving segment=
ation fault problem. The trace and the code is as below:<br />reg =3D<br />=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_create_handler_registrat=
ion("MylTable",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&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
R_CAN_RWRITE);<br />&nbsp;&nbsp;&nbsp; reg-&gt;contextName =3D strdup("myco=
ntext");<br />&nbsp;&nbsp;&nbsp; netsnmp_register_handler(reg);<br /><br />=
the seg fault back trace is: <br /><br />#0&nbsp; 0xb772c36b in strlen () f=
rom /lib/libc.so.6<br />#1&nbsp; 0xb772c0d5 in strdup () from /lib/libc.so.=
6<br />#2&nbsp; 0xb79fa0f3 in agentx_register () from /usr/lib/libnetsnmpag=
ent.so.15<br />#3&nbsp; 0xb79e8af1 in agentx_registration_callback () from =
/usr/lib/libnetsnmpagent.so.15<br />#4&nbsp; 0xb795a727 in snmp_call_callba=
cks () from /usr/lib/libnetsnmp.so.15<br />#5&nbsp; 0xb79dd1e0 in register_=
mib_reattach_node () from /usr/lib/libnetsnmpagent.so.15<br />#6&nbsp; 0xb7=
9dd22f in register_mib_reattach () from /usr/lib/libnetsnmpagent.so.15<br /=
>#7&nbsp; 0xb79e96ca in agentx_reopen_session () from /usr/lib/libnetsnmpag=

ent.so.15<br />#8&nbsp; 0xb79e6ca3 in subagent_startup () from /usr/lib/lib=
netsnmpagent.so.15<br />#9&nbsp; 0xb795a727 in snmp_call_callbacks () from =
/usr/lib/libnetsnmp.so.15<br />#10 0xb794dfff in read_configs () from /usr/=
lib/libnetsnmp.so.15<br />#11 0xb792b118 in init_snmp () from /usr/lib/libn=
etsnmp.so.15<br />#12 0x082b6aac in snmpsubagent () at /root/home/snmp/src/=
SnmpInit.cc:407<br />#13 0xb7ba8001 in ?? () from /lib/libpthread.so.0<br /=
>#14 0x00000000 in ?? ()<br /><br />For tables do I have to do anything dif=

ferent?<br /><br />On Fri, 4 Jan 2008 12:46:30 +0000 "Dave Shield" wrote<b=
r /> On 4 Jan 2008 12:35:06 -0000, girish wrote:<br /> &gt; Well here is=
the snmpd.conf file which I 've configured<br /> <br /> Just concentrati=
ng the access control settings,<br /> you have:<br /> <br /> &gt; rwuser=
myuser<br /> &gt; rwuser myuser<br /> &gt; rwuser myuser<br /> &gt; rwu=
ser myuser<br /> <br /> i.e. four copies of the same entry!<br /> plus:<=
br /> <br /> &gt; access mygroup "mycontext" authNoPriv myuser<br /> <br=
/> which is not the correct syntax for the "access" directive.<br /> <br=
/> Please re-read the documentation for access control,<br /> either in =
snmpd.conf(5) or the FAQ entry<br /> I don't understand the new access =
control stuff - what does it mean?<br /> http://www.net-snmp.org/w=
iki/index.php/FAQ:Agent_24<br /> <br /> If you don't configure things cor=
rectly, then no - it won't work.<br /> <br /> Dave<br /> <br /> -------=
------------------------------------------------------------------<br /> T=
his SF.net email is sponsored by: Microsoft<br /> Defy all challenges. Mic=
rosoft(R) Visual Studio 2005.<br /> http://clk.atdmt.com/MRT/go/vse0120000=
070mrt/direct/01/<br /> _______________________________________________<br =
/> Net-snmp-users mailing list<br /> Net-snmp-users@lists.sourceforge.ne=
t<br /> Please see the following page to unsubscribe or change other optio=
ns:<br /> https://lists.sourceforge.net/lists/listinfo/net-snmp-users<br /=
> <br /> =20

<br><br>Regards,<br />
Girish<br><Table border=3D0 Width=3D644 Height=3D57 cellspacing=3D0 cellpad=
ding=3D0 style=3D'font-family:Verdana;font-size:11px;line-height:15px;'><TR=
><td><img src =3Dhttp://imadworks.rediff.com/cgi-bin/AdWorks/adimage.cgi/20=

25376_2018199/creative_2025098.gif alt=3D'default blank signature' border=
=3D0></td></TR></Table>
--=_b4dd795d00e9741a0151af7ffc94693d--


--===============1815014904==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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/
--===============1815014904==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

--===============1815014904==--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:12 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0