RE: Managing multiple instances of a MIB

This is a discussion on RE: Managing multiple instances of a MIB within the SNMP Coders forums, part of the Networking and Network Related category; This fix didn't work for me. Infact, after applying this patch, snmpd process froze at the following location. The ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2005
Riju Kallivalappil
 
Posts: n/a
Default RE: Managing multiple instances of a MIB

This fix didn't work for me. Infact, after applying this patch, snmpd
process froze at the following location. The stack trace looks a bit
weird though. According to the stack trace the process got stuck in a
call to free().

(gdb) run -r -f -C -c /home/riju/tools/scripts/snmpd.conf -d -r -Lo -V
-x 127.0.0.1:7005 -Dagentx udp:8765
Starting program: /tmp/snmp/sbin/snmpd -r -f -C -c
/home/riju/tools/scripts/snmpd.conf -d -r -Lo -V -x 127.0.0.1:7005
-Dagentx udp:8765
agentx/subagent: init_subagent sess 09fc48a8
agentx_register_app_config_handler: registering .conf token for
"agentxsocket"
agentx_register_app_config_handler: registering .conf token for
"agentxperms"
agentx_register_app_config_handler: registering .conf token for
"agentxRetries"
agentx_register_app_config_handler: registering .conf token for
"agentxTimeout"
Turning on AgentX master support.
agentx/master: initializing...
agentx/master: initializing... DONE
read_config_store open failure on /var/net-snmp/snmpd.conf
read_config_store open failure on /var/net-snmp/snmpd.conf
read_config_store open failure on /var/net-snmp/snmpd.conf
read_config_store open failure on /var/net-snmp/snmpd.conf
read_config_store open failure on /var/net-snmp/snmpd.conf
read_config_store open failure on /var/net-snmp/snmpd.conf

Sending 44 bytes to UDP: [127.0.0.1]:8764
0000: 30 2A 02 01 00 04 06 70 75 62 6C 69 63 A4 1D 06
0*.....public...
0016: 0A 2B 06 01 04 01 BF 08 03 02 0A 40 04 C0 A8 03
..+.........@....
0032: F4 02 01 00 02 01 00 43 01 0B 30 00 .......C..0.


Sending 95 bytes to UDP: [127.0.0.1]:8764
0000: 30 5D 02 01 01 04 06 70 75 62 6C 69 63 A7 50 02
0].....public.P.
0016: 04 06 22 E2 0F 02 01 00 02 01 00 30 42 30 0D 06
..."........0B0..
0032: 08 2B 06 01 02 01 01 03 00 43 01 0B 30 17 06 0A
..+.......C..0...
0048: 2B 06 01 06 03 01 01 04 01 00 06 09 2B 06 01 06
+...........+...
0064: 03 01 01 05 01 30 18 06 0A 2B 06 01 06 03 01 01
......0...+......
0080: 04 03 00 06 0A 2B 06 01 04 01 BF 08 03 02 0A
......+.........

NET-SNMP version 5.2.1

Received 80 bytes from TCP: [127.0.0.1]:33150
0000: 01 01 00 00 00 00 00 00 00 00 00 00 26 E9 C3 0C
.............&...
0016: 3C 00 00 00 00 00 00 00 05 04 00 00 01 00 00 00
<...............
0032: 88 1F 00 00 03 00 00 00 02 00 00 00 0A 00 00 00
.................
0048: 19 00 00 00 4E 65 74 2D 53 4E 4D 50 20 41 67 65 ....Net-SNMP
Age
0064: 6E 74 58 20 73 75 62 2D 61 67 65 6E 74 00 00 00 ntX
sub-agent...

agentx/master: handle pdu (req=3D0xcc3e926,trans=3D0x0,sess=3D0x0)
agentx/master: open 0xa04abb8
agentx/master: opened 0xa05b668 =3D 8 with flags =3D a0
agentx/master: send response, stat 0 =
(req=3D0xcc3e926,trans=3D0x0,sess=3D0x0)
agentx_build: packet built okay

Sending 88 bytes to TCP: [127.0.0.1]:33150
0000: 01 12 00 00 08 00 00 00 00 00 00 00 26 E9 C3 0C
.............&...
0016: 44 00 00 00 C0 0A 00 00 00 00 00 00 04 00 00 00
D...............
0032: 05 04 00 00 01 00 00 00 88 1F 00 00 03 00 00 00
.................
0048: 02 00 00 00 0A 00 00 00 19 00 00 00 4E 65 74 2D
.............Net-
0064: 53 4E 4D 50 20 41 67 65 6E 74 58 20 73 75 62 2D SNMP AgentX
sub-
0080: 61 67 65 6E 74 00 00 00 agent...


Received 52 bytes from TCP: [127.0.0.1]:33150
0000: 01 03 08 00 08 00 00 00 00 00 00 00 27 E9 C3 0C
.............'...
0016: 20 00 00 00 0D 00 00 00 73 6C 73 61 6C 70 68 61
........slsalpha
0032: 3A 37 38 38 38 00 00 00 00 00 00 00 01 00 00 00
:7888...........
0048: 00 00 00 00 ....

agentx/master: handle pdu (req=3D0xcc3e927,trans=3D0x0,sess=3D0x8)
agentx/master: in register_agentx_list
agentx/master: duplicate registration
agentx/master: send response, stat 263
(req=3D0xcc3e927,trans=3D0x0,sess=3D0x8)
agentx_build: packet built okay

Sending 40 bytes to TCP: [127.0.0.1]:33150
0000: 01 12 00 00 08 00 00 00 00 00 00 00 27 E9 C3 0C
.............'...
0016: 14 00 00 00 C0 0A 00 00 07 01 00 00 05 00 00 00
.................
0032: 01 00 00 00 00 00 00 00 ........


Program received signal SIGINT, Interrupt.
0x00d76304 in malloc_consolidate () from /lib/tls/libc.so.6
(gdb) where
#0 0x00d76304 in malloc_consolidate () from /lib/tls/libc.so.6
#1 0x00d7619d in _int_free () from /lib/tls/libc.so.6
#2 0x00d75018 in free () from /lib/tls/libc.so.6
#3 0x00a7830b in _sess_read (sessp=3D0xa03edc0, fdset=3D0xbfff9360)
at snmp_api.c:5574
#4 0x00a78594 in snmp_sess_read (sessp=3D0xa03edc0, fdset=3D0xbfff9360)
at snmp_api.c:5625
#5 0x00a7780e in snmp_read (fdset=3D0xbfff9360) at snmp_api.c:5260
#6 0x0804b712 in receive () at snmpd.c:1149
#7 0x0804b16d in main (argc=3D14, argv=3D0xbfffa564) at snmpd.c:993


The subagent process's stack trace at that time is given below:


(gdb) where
#0 0x00cb3c88 in ___newselect_nocancel () from /lib/tls/libc.so.6
#1 0x001d1f9c in snmp_synch_response_cb (ss=3D0xa31aad0, =
pdu=3D0xa31c3f0,=20
response=3D0xbfffbebc, pcb=3D0x97ed2c <agentx_synch_input>)
at snmp_client.c:811
#2 0x0097ef11 in agentx_synch_response (ss=3D0xa31aad0, =
pdu=3D0xa31c3f0,=20
response=3D0xbfffbebc) at mibgroup/agentx/client.c:116
#3 0x0097f3ce in agentx_register (ss=3D0xa31aad0, start=3D0xa31c2b8,
startlen=3D1,=20
priority=3D0, range_subid=3D0, range_ubound=3D0, timeout=3D0, =
flags=3D0 '\0',=20
contextName=3D0xa31c350 "slsalpha:7888") at
mibgroup/agentx/client.c:223
#4 0x009720af in agentx_registration_callback (majorID=3D1, =
minorID=3D1,=20
serverarg=3D0xbfffbfa0, clientarg=3D0xa31aad0)
at mibgroup/agentx/subagent.c:575
#5 0x0020ec3f in snmp_call_callbacks (major=3D1, minor=3D1,
caller_arg=3D0xbfffbfa0)
at callback.c:224
#6 0x00968542 in netsnmp_register_mib (moduleName=3D0xa31c2c8 "",
var=3D0x0,=20
varsize=3D0, numvars=3D0, mibloc=3D0xa31c2b8, mibloclen=3D1, =
priority=3D0,=20
range_subid=3D0, range_ubound=3D0, ss=3D0x0, context=3D0xa31c350
"slsalpha:7888",=20
timeout=3D0, flags=3D0, reginfo=3D0xa31c5b8, perform_callback=3D1)
at agent_registry.c:691
#7 0x0096d233 in netsnmp_register_handler (reginfo=3D0xa31c5b8)
at agent_handler.c:255
#8 0x0091e08e in netsnmp_register_null_context (loc=3D0xa31c2b8,
loc_len=3D1,=20
contextName=3D0xa31bca0 "slsalpha:7888") at null.c:38
#9 0x00967e26 in netsnmp_subtree_load (new_sub=3D0xa31bdb8,=20
context_name=3D0xa31bca0 "slsalpha:7888") at agent_registry.c:397
#10 0x00968387 in netsnmp_register_mib (moduleName=3D0xa31bc60
"gdcGpsWeek",=20
var=3D0x0, varsize=3D0, numvars=3D0, mibloc=3D0xa31bcb8, =
mibloclen=3D11,=20
priority=3D127, range_subid=3D0, range_ubound=3D0, ss=3D0x0,=20
context=3D0xa31bca0 "slsalpha:7888", timeout=3D0, flags=3D0,
reginfo=3D0xa31bc28,=20
perform_callback=3D1) at agent_registry.c:629
#11 0x0096d233 in netsnmp_register_handler (reginfo=3D0xa31bc28)
at agent_handler.c:255
#12 0x0091fe75 in netsnmp_register_serialize (reginfo=3D0xa31bc28)
at serialize.c:46
#13 0x0091d061 in netsnmp_register_scalar (reginfo=3D0xa31bc28) at
scalar.c:91

-----Original Message-----
From: Robert Story [mailto:rstory@freesnmp.com]=20
Sent: Tuesday, February 15, 2005 3:44 PM
To: Riju Kallivalappil
Cc: net-snmp-coders@lists.sourceforge.net
Subject: Re: Managing multiple instances of a MIB

On Tue, 15 Feb 2005 10:55:17 -0800 Riju wrote:
RK> On Fri, 11 Feb 2005 16:56:17 -0800 Riju wrote:
RK> RK> Do SNMP v3 contexts work with agentx in 5.2.1?=20
RK>=20
RK> Yes, they should.

But apparently they don't. Sigh.

RK> RK> I've been trying to get this work for the past few days. I was
trying
RK> RK> with 5.2 initially. Didn't work. So, I tried upgrading to 5.2.1.
Still
RK> RK> doesn't work. When I turn on the debug level logs I can see that
the
RK> RK> master agent forwards the request to the correct subagent. But,
the
RK> RK> context information doesn't seem to reach the subagent. And
subagent
RK> RK> returns " No Such Object available on this agent at this OID"
error.
RK> RK>=20
RK> RK> (This setup works fine when I do not use a context or use the
context
RK> RK> "")

I *know* that I tested this, so I'm not sure how it got broken. But it
does
indeed appear to be broken. Try this simple patch and see if it gets you
going:

Index: mibgroup/agentx/master_admin.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
RCS file:
/cvsroot/net-snmp/net-snmp/agent/mibgroup/agentx/master_admin.c,v
retrieving revision 5.6
diff -u -r5.6 master_admin.c
--- mibgroup/agentx/master_admin.c 9 Nov 2002 15:06:40 -0000
5.6
+++ mibgroup/agentx/master_admin.c 15 Feb 2005 23:41:55 -0000
@@ -229,6 +229,9 @@
=20
reg->handler->myvoid =3D session;
reg->global_cacheid =3D cacheid;
+ if (NULL !=3D pdu->community)
+ reg->contextName =3D pdu->community;
+
/*
* register mib. Note that for failure cases, the registration info
* (reg) will be freed, and thus is no longer a valid pointer.


--=20
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive:
<http://sourceforge.net/mailarchive/forum.php?forum=3Dnet-snmp-coders>

You are lost in a twisty maze of little standards, all different.=20


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
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

vB 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 02:16 AM.


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