snmpwalk is sending an exact request when walking a tree

"mn kh" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all,

I am trying to use a subagent (agentx), and I came across a huge problem
which I can't seem to solve.
Following is my mib as printed by print_mib function:
Children of mmsc(8):
                  JINNY-MMSC-MIB:wret-error(91) type=6
                  JINNY-MMSC-MIB:wret-ok(90) type=6
                  JINNY-MMSC-MIB:wret-total(89) type=6
                  JINNY-MMSC-MIB:smsnot-alive(88) type=6
                  JINNY-MMSC-MIB:smsnot-error(87) type=6
                  JINNY-MMSC-MIB:smsnot-ok(86) type=6
                  JINNY-MMSC-MIB:smsnot-total(85) type=6
                  JINNY-MMSC-MIB:mrep-alive(84) type=6
                  JINNY-MMSC-MIB:mrep-prepaid(83) type=6
                  JINNY-MMSC-MIB:mrep-postpaid(82) type=6
                  JINNY-MMSC-MIB:mrep-unrecognized(81) type=6
                  JINNY-MMSC-MIB:mrep-deferred(80) type=6
                  JINNY-MMSC-MIB:mrep-rejected(79) type=6
                  JINNY-MMSC-MIB:mrep-retrieved(78) type=6
                  JINNY-MMSC-MIB:mrep-expired(77) type=6
                  JINNY-MMSC-MIB:mrep-error(76) type=6
                  JINNY-MMSC-MIB:mrep-ok(75) type=6
                  JINNY-MMSC-MIB:mrep-total(74) type=6
                  JINNY-MMSC-MIB:mack-allowedreport(73) type=6
                  JINNY-MMSC-MIB:mack-error(72) type=6
                  JINNY-MMSC-MIB:mack-ok(71) type=6
                  JINNY-MMSC-MIB:mack-total(70) type=6
                  JINNY-MMSC-MIB:mret-sizebt250k(69) type=6
                  JINNY-MMSC-MIB:mret-size120to250k(68) type=6
                  JINNY-MMSC-MIB:mret-size60to120k(67) type=6
                  JINNY-MMSC-MIB:mret-size30to60k(66) type=6
                  JINNY-MMSC-MIB:mret-size20to30k(65) type=6
                  JINNY-MMSC-MIB:mret-size10to20k(64) type=6
                  JINNY-MMSC-MIB:mret-size5to10k(63) type=6
                  JINNY-MMSC-MIB:mret-size0to5k(62) type=6
                  JINNY-MMSC-MIB:mret-size-total(61) type=6
                  JINNY-MMSC-MIB:mret-prepaid(60) type=6
                  JINNY-MMSC-MIB:mret-postpaid(59) type=6
                  JINNY-MMSC-MIB:mret-senderhidden(58) type=6
                  JINNY-MMSC-MIB:mret-prio-high(57) type=6
                  JINNY-MMSC-MIB:mret-prio-normal(56) type=6
                  JINNY-MMSC-MIB:mret-prio-low(55) type=6
                  JINNY-MMSC-MIB:mret-reportrequested(54) type=6
                  JINNY-MMSC-MIB:mret-class-aut(53) type=6
                  JINNY-MMSC-MIB:mret-class-inf(52) type=6
                  JINNY-MMSC-MIB:mret-class-adv(51) type=6
                  JINNY-MMSC-MIB:mret-class-per(50) type=6
                  JINNY-MMSC-MIB:mret-error(49) type=6
                  JINNY-MMSC-MIB:mret-ok(48) type=6
                  JINNY-MMSC-MIB:mret-total(47) type=6
                  JINNY-MMSC-MIB:mnotresp-allowedreport(46) type=6
                  JINNY-MMSC-MIB:mnotresp-unrecognized(45) type=6
                  JINNY-MMSC-MIB:mnotresp-deferred(44) type=6
                  JINNY-MMSC-MIB:mnotresp-rejected(43) type=6
                  JINNY-MMSC-MIB:mnotresp-retrieved(42) type=6
                  JINNY-MMSC-MIB:mnotresp-error(41) type=6
                  JINNY-MMSC-MIB:mnotresp-ok(40) type=6
                  JINNY-MMSC-MIB:mnotresp-total(39) type=6
                  JINNY-MMSC-MIB:mnot-alive(38) type=6
                  JINNY-MMSC-MIB:mnot-prepaid(37) type=6
                  JINNY-MMSC-MIB:mnot-postpaid(36) type=6
                  JINNY-MMSC-MIB:mnot-error(35) type=6
                  JINNY-MMSC-MIB:mnot-ok(34) type=6
                  JINNY-MMSC-MIB:mnot-total(33) type=6
                  JINNY-MMSC-MIB:msend-dest-mm7(32) type=6
                  JINNY-MMSC-MIB:msend-src-mm7(31) type=6
                  JINNY-MMSC-MIB:msend-dest-mm4(30) type=6
                  JINNY-MMSC-MIB:msend-src-mm4(29) type=6
                  JINNY-MMSC-MIB:msend-dest-mm3(28) type=6
                  JINNY-MMSC-MIB:msend-src-mm3(27) type=6
                  JINNY-MMSC-MIB:msend-dest-mm1(26) type=6
                  JINNY-MMSC-MIB:msend-src-mm1(25) type=6
                  JINNY-MMSC-MIB:msend-sizebt250k(24) type=6
                  JINNY-MMSC-MIB:msend-size120to250k(23) type=6
                  JINNY-MMSC-MIB:msend-size60to120k(22) type=6
                  JINNY-MMSC-MIB:msend-size30to60k(21) type=6
                  JINNY-MMSC-MIB:msend-size20to30k(20) type=6
                  JINNY-MMSC-MIB:msend-size10to20k(19) type=6
                  JINNY-MMSC-MIB:msend-size5to10k(18) type=6
                  JINNY-MMSC-MIB:msend-size0to5k(17) type=6
                  JINNY-MMSC-MIB:msend-size-total(16) type=6
                  JINNY-MMSC-MIB:msend-prepaid(15) type=6
                  JINNY-MMSC-MIB:msend-postpaid(14) type=6
                  JINNY-MMSC-MIB:msend-wantsreadreply(13) type=6
                  JINNY-MMSC-MIB:msend-hidesender(12) type=6
                  JINNY-MMSC-MIB:msend-prio-high(11) type=6
                  JINNY-MMSC-MIB:msend-prio-normal(10) type=6
                  JINNY-MMSC-MIB:msend-prio-low(9) type=6
                  JINNY-MMSC-MIB:msend-wantsreport(8) type=6
                  JINNY-MMSC-MIB:msend-class-aut(7) type=6
                  JINNY-MMSC-MIB:msend-class-inf(6) type=6
                  JINNY-MMSC-MIB:msend-class-adv(5) type=6
                  JINNY-MMSC-MIB:msend-class-per(4) type=6
                  JINNY-MMSC-MIB:msend-error(3) type=6
                  JINNY-MMSC-MIB:msend-ok(2) type=6
                  JINNY-MMSC-MIB:msend-total(1) type=6

when i run the subagent and the snmpd and i try to walk this tree this is
what happens in the logfile:

var_jAgentX -> Handling an exact request...
10:48:56.641 ( 4858) 5 var_jAgentX ->
name=enterprises.jinny.generic.mmsc.msend-total
10:48:56.641 ( 4858) 5 var_jAgentX -> It's not a table
10:48:56.641 ( 4858) 4 var_jAgentX -> header_generic failed for mmsc!
10:48:56.641 ( 4858) 3 var_jAgentX -> Handling an inexact request...
10:48:56.641 ( 4858) 5 var_jAgentX -> (before) name =
enterprises.jinny.generic.mmsc.msend-total
10:48:56.641 ( 4858) 5 var_jAgentX -> (before) vp->name =
enterprises.jinny.generic.mmsc.msend-total
10:48:56.641 ( 4858) 5 var_jAgentX -> (after) vp->name =
enterprises.jinny.generic.mmsc.msend-total
10:48:56.641 ( 4858) 5 var_jAgentX -> (after) name =
enterprises.jinny.generic.mmsc.msend-total.0
10:48:56.641 ( 4858) 6 inexact_request_handle -> pass=0

it thinks that i have sent an exact request. Furthermore, below is an
extract of the same request when i used a dynamically loaded subagent:

11:06:20.638 (16338) 3 var_jsnmp -> Handling an inexact request...
11:06:20.638 (16338) 5 var_jsnmp -> (before) name =
enterprises.jinny.generic.mmsc
11:06:20.638 (16338) 5 var_jsnmp -> (before) vp->name =
enterprises.jinny.generic.mmsc.msend-total
11:06:20.638 (16338) 5 var_jsnmp -> (after) vp->name =
enterprises.jinny.generic.mmsc.msend-total
11:06:20.638 (16338) 5 var_jsnmp -> (after) name =
enterprises.jinny.generic.mmsc.msend-total.0

and I think that the subagent agentx should output the same thing

In fact I am fetching the counters from a shared memory, so when the counter
isn't found a return NULL should be passed and snmp should go to the next
child in the MMSC tree. But this is not what's happening. In fact in my
shared memory I only have the counters:
                  JINNY-MMSC-MIB:smsnot-alive(88) type=6
                  JINNY-MMSC-MIB:smsnot-error(87) type=6
                  JINNY-MMSC-MIB:smsnot-ok(86) type=6
                  JINNY-MMSC-MIB:smsnot-total(85) type=6
so what's happening is that when snmp reaches the
JINNY-MMSC-MIB:smsnot-total(85) it returns the value that i have extracted
from the shared memory and then he goes back to the second counter and
rewalk the tree
                  JINNY-MMSC-MIB:msend-ok(2) type=6
and when he reaches
                  JINNY-MMSC-MIB:smsnot-ok(86) type=6
he goes back to the third counter and rewalk the tree
                  JINNY-MMSC-MIB:msend-error(3) type=6
and so on. So snmp is walking the tree thousands of times more then he
should and i think its because he understood that i sent an exact request.
So when i use the simple
[jinny@florida bin]$ ./snmpwalk -c public localhost mmsc
Timeout: No Response from localhost
the request times out and if i use
[jinny@florida bin]$ ./snmpwalk -t 10 -c public localhost mmsc
JINNY-MMSC-MIB::smsnot-total.0 = Counter32: 0
JINNY-MMSC-MIB::smsnot-ok.0 = Counter32: 0
JINNY-MMSC-MIB::smsnot-error.0 = Counter32: 0
JINNY-MMSC-MIB::smsnot-alive.0 = Counter32: 8

If you require any addtional logs or information please do not hesitate to
contact me
Thank You,

Regards

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

_______________________________________________
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.