Re: agentx comms problem

Thomas Andrews <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dave Shield wrote:
> On 25 March 2010 08:11, Thomas Andrews <[email protected]> wrote:
>>> Problem: when I do this:
>>>
>>>   snmpget -v1 -c public localhost nstAgentSubagentObject.0
>>>
>>> I get:
>>>
>>>   Error in packet
>>>   Reason: (noSuchName) There is no such variable name in this MIB.
>>>   Failed object: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
> 
> Two questions:
>   a)  What do the access control settings look like for the master agent?
>        Can you see other parts of the OID tree?

com2sec paranoid  0.0.0.0/0         public
com2sec readonly  0.0.0.0/0         public
com2sec readwrite 0.0.0.0/0         private
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included  .iso.org.dod.internet.mgmt.mib-2.system
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none

I can see everything under .iso.org.dod.internet.mgmt.mib-2.system. 
Nothing else...

> 
>   b)  What does the code for registering this module in the subagent look like?
> 

Verbatim from the tutorial:

http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/nstAgentSubagentObject.c
http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/nstAgentSubagentObject.h
http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/example-demon.c
> 
> Comparing the packet dumps, it feels as if the AgentX registration
> 
>> 0000: 01 12 01 00  0D 00 00 00  00 00 00 00  57 E4 DE 21    ............WäÞ!
>> 0016: 30 00 00 00  60 6C 02 00  00 00 00 00  05 00 00 00    0...`l..........
>> 0032: 08 04 00 00  01 00 00 00  88 1F 00 00  02 00 00 00    ................
>> 0048: 04 00 00 00  01 00 00 00  01 00 00 00  02 00 00 00    ................
>> 0064: 00 00 00 00                                           ....
> 
> is registering one OID  (1.3.6.1.4.1.34847.2.4.1.1.2.0)
> 
> while the SNMP request:
> 
>> 0000: 30 2C 02 01  00 04 06 70  75 62 6C 69  63 A0 1F 02    0,.....public ..
>> 0016: 02 34 89 02  01 00 02 01  00 30 13 30  11 06 0D 2B    .4.......0.0...+
>> 0032: 06 01 04 01  BF 08 02 04  01 01 02 00  05 00          ....¿.........
> 
> is asking for a different OID  (1.3.6.1.4.1.8072.2.4.1.1.2.0)
> 
> 
> Now I could well have got that decoding wrong - it's probably worth
> running the master agent using -Ddump, and check the contents of
> the agentx-Register-PDU.   See exactly what the master agent thinks
> is being registered.
> But if that doesn't match the OID being asked for, then of course the
> master agent won't ever call your subagent.
> 

The 'register' command looks like it registers the correct oid:
<snip>
dumpv_recv:         OID: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
<snip>
dumpv_send:         OID: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
<snip>

The 'GET' appears to be correct in spite of the fact that it is encoded 
as BF08. Here is the output from the 'GET' using -Ddump -Dagentx:

Connection from UDP: [10.1.1.2]:57461
dumpx_recv:02 01 00
dumpv_recv:  Integer:   0 (0x00)
dumph_recv: SNMPv1 message

dumph_recv:   SNMP version
dumpx_recv:    02 01 00
dumpv_recv:      Integer:       0 (0x00)
dumph_recv:   community string
dumpx_recv:    04 06 70 75 62 6C 69 63
dumpv_recv:      String:        public
dumph_recv:   PDU
dumpv_recv:     Command GET
dumph_recv:     request_id
dumpx_recv:      02 02 34 B3
dumpv_recv:        Integer:     13491 (0x34B3)
dumph_recv:     error status
dumpx_recv:      02 01 00
dumpv_recv:        Integer:     0 (0x00)
dumph_recv:     error index
dumpx_recv:      02 01 00
dumpv_recv:        Integer:     0 (0x00)
dumph_recv:     VarBindList
dumph_recv:       VarBind
dumph_recv:         Name
dumpx_recv:          06 0D 2B 06 01 04 01 BF 08 02 04 01 01 02 00
dumpv_recv:            ObjID: 
NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
dumph_recv:         Value
dumph_send: RESPONSE
dumph_send:   VarBind
dumph_send:     Value
dumpx_send:      05 00
dumpv_send:        NULL
dumph_send:     Name
dumpx_send:      06 0D 2B 06 01 04 01 BF 08 02 04 01 01 02 00
dumpv_send:        ObjID: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0
dumph_send: error index
dumpx_send:  02 01 01
dumpv_send:    Integer: 1 (0x01)
dumph_send: error status
dumpx_send:  02 01 02
dumpv_send:    Integer: 2 (0x02)
dumph_send: request_id
dumpx_send:  02 02 34 B3
dumpv_send:    Integer: 13491 (0x34B3)
dumph_send: Community String
dumpx_send:  04 06 70 75 62 6C 69 63
dumpv_send:    String:  public
dumph_send: SNMP Version Number
dumpx_send:  02 01 00
dumpv_send:    Integer: 0 (0x00)
dumph_send: SNMPv1 Message

Many thanks,
Thomas

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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.