Re: MFD compiled extension agent: snmpget returns Timeout: No Response from localhost:1161.

2014-09-06 Thread Bill Fenner
On Fri, Sep 5, 2014 at 1:57 AM, Kenneth Hung hun...@gmail.com wrote:

 netsnmp_udp_getSecName: no com2sec entries   Am I
 missing something here in the conf file?


Yes - despite your subject line mentioning extension agent, you're running
a full agent, meaning that you have to configure it for access control as
described in http://www.net-snmp.org/wiki/index.php/FAQ:Agent_24 .  You
need to use the configuration file with the name that you passed to
init_snmp().

  Bill
--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: MFD compiled extension agent: snmpget returns Timeout: No Response from localhost:1161.

2014-09-05 Thread Kenneth Hung
I turned on debugging info with -D all and captured the last portion
which I believed is the last transaction of the 5 or so transactions in the
previously mentioned :

Connection from UDP: [127.0.0.1]:55176-[127.0.0.1

I executed:
./adeSensorsTable -f -L -D all -M localhost:1161

Following is the partial capture, I'm not sure what's the internal snmpd
receive packet processing details so can't interpret the dump.  It appears
to me that the code was looking for SecName entry that it couldn't find in
(my?) adeSensorsTable.conf file perhaps, please see  for my comment
below :

netsnmp_udp: recvfrom fd 7 got 48 bytes (from UDP:
[127.0.0.1]:54826-[127.0.0.1])
trace: _sess_process_packet(): snmp_api.c, 5113:
sess_process_packet: session 0x81a5438 fd 7 pkt 0x81bed40 length 48
Connection from UDP: [127.0.0.1]:54826-[127.0.0.1]
dumpx_recv:02 01 00
dumpv_recv:  Integer: 0 (0x00)
trace: _snmp_parse(): snmp_api.c, 4115:
snmp_api: Parsing SNMPv1 message...
trace: _snmp_parse(): snmp_api.c, 4122:
dumph_recv: SNMPv1 message

trace: snmp_comstr_parse(): snmp_auth.c, 135:
dumph_recv:   SNMP version
dumpx_recv:02 01 00
dumpv_recv:  Integer: 0 (0x00)
trace: snmp_comstr_parse(): snmp_auth.c, 147:
dumph_recv:   community string
dumpx_recv:04 06 70 75 62 6C 69 63
dumpv_recv:  String: public
trace: _snmp_parse(): snmp_api.c, 4171:
dumph_recv:   PDU
trace: snmp_pdu_parse(): snmp_api.c, 4277:
dumpv_recv: Command GET
trace: snmp_pdu_parse(): snmp_api.c, 4358:
dumph_recv: request_id
dumpx_recv:  02 04 07 C5 C4 53
dumpv_recv:Integer: 130401363 (0x7C5C453)
trace: snmp_pdu_parse(): snmp_api.c, 4369:
dumph_recv: error status
dumpx_recv:  02 01 00
dumpv_recv:Integer: 0 (0x00)
trace: snmp_pdu_parse(): snmp_api.c, 4380:
dumph_recv: error index
dumpx_recv:  02 01 00
dumpv_recv:Integer: 0 (0x00)
trace: snmp_pdu_parse(): snmp_api.c, 4398:
dumph_recv: VarBindList
trace: snmp_pdu_parse(): snmp_api.c, 4428:
dumph_recv:   VarBind
trace: snmp_parse_var_op(): snmp.c, 166:
dumph_recv: Name
dumpx_recv:  06 0D 2B 06 01 04 01 82 D7 01 01 01 01 01 02
dumpv_recv:ObjID: SNMPv2-SMI::enterprises.43905.1.1.1.1.2
trace: snmp_pdu_parse(): snmp_api.c, 4437:
dumph_recv: Value
trace: init_agent_snmp_session(): snmp_agent.c, 1292:
snmp_agent: agent_sesion 0x81aca60 created
trace: init_agent_snmp_session(): snmp_agent.c, 1307:
verbose:asp: asp 0x81aca60 reqinfo 0x81758b0 created
trace: _callback_lock(): callback.c, 130:
9:callback:lock: locked (APP,null)
trace: snmp_call_callbacks(): callback.c, 322:
callback: START calling callbacks for maj=1 min=5
trace: snmp_call_callbacks(): callback.c, 336:
callback: calling a callback for maj=1 min=5
trace: vacm_check_view(): mibgroup/mibII/vacm_conf.c, 1304:
mibII/vacm_vars: vacm_in_view: ver=0, community=public
trace: netsnmp_udp_getSecName(): snmpUDPDomain.c, 1240:
netsnmp_udp_getSecName: no com2sec entries   Am I
missing something here in the conf file?
trace: vacm_check_view(): mibgroup/mibII/vacm_conf.c, 1402:
mibII/vacm_vars: vacm_in_view: No security name found
trace: snmp_call_callbacks(): callback.c, 348:
callback: END calling callbacks for maj=1 min=5 (1 called)
trace: _callback_unlock(): callback.c, 164:
9:callback:lock: unlocked (APP,null)
trace: netsnmp_send_traps(): agent_trap.c, 643:
trap: send_trap 4 0 NET-SNMP-MIB::netSnmpAgentOIDs.10
trace: netsnmp_remove_and_free_agent_snmp_session(): snmp_agent.c, 1740:
snmp_agent: REMOVE session == 0x81aca60
trace: free_agent_snmp_session(): snmp_agent.c, 1318:
snmp_agent: agent_session 0x81aca60 released
trace: free_agent_snmp_session(): snmp_agent.c, 1323:
verbose:asp: asp 0x81aca60 reqinfo 0x81758b0 freed
trace: agent_snmp_session_release_cancelled(): snmp_agent.c, 3787:
agent:cancelled: Removing session 0x81aca60
trace: _sess_read(): snmp_api.c, 5437:
sess_read: not reading 5 (fdset 0xbf8ddb40 set 0)
trace: _sess_read(): snmp_api.c, 5437:
sess_read: not reading 3 (fdset 0xbf8ddb40 set 0)
trace: snmp_sess_select_info(): snmp_api.c, 5860:
sess_select: for all sessions: 7 5 3
sess_select: next alarm 0.5897943 sec
sess_select: blocking:no session requests or alarms.

Thanks,


On Thu, Sep 4, 2014 at 5:13 PM, Kenneth Hung hun...@gmail.com wrote:

 I'm new to Linux. I'm writing an SNMP extension agent using the MIB for
 Dummies (http://www.net-snmp.org/wiki/index.php/MIB_for_Dummies) config
 file (mib2c.mfd.conf). I successfully created my executable,
 adeSensorsTable, using my own adeSensorsTable.MIB (mib2c util
 auto-generated the C source code from adeSensorsTable.MIB, using
 mib2c.mfd.conf config file, which I compiled into an executable). I then
 ran my executable:

 On my 1st terminal, I typed:
 ./adeSensorsTable -f -L -DadeSensorsTable -M localhost:1161
 It returns:
 No log handling enabled - turning on stderr logging
 registered debug token adeSensorsTable, 1
 adeSensorsTable:init_adeSensorsTable: Registering adeSensorsTable as a
 

MFD compiled extension agent: snmpget returns Timeout: No Response from localhost:1161.

2014-09-04 Thread Kenneth Hung
I'm new to Linux. I'm writing an SNMP extension agent using the MIB for
Dummies (http://www.net-snmp.org/wiki/index.php/MIB_for_Dummies) config
file (mib2c.mfd.conf). I successfully created my executable,
adeSensorsTable, using my own adeSensorsTable.MIB (mib2c util
auto-generated the C source code from adeSensorsTable.MIB, using
mib2c.mfd.conf config file, which I compiled into an executable). I then
ran my executable:

On my 1st terminal, I typed:
./adeSensorsTable -f -L -DadeSensorsTable -M localhost:1161
It returns:
No log handling enabled - turning on stderr logging
registered debug token adeSensorsTable, 1
adeSensorsTable:init_adeSensorsTable: Registering adeSensorsTable as a
mibs-for-dummies table.

-
On my 2nd terminal of the same PC:
I then tried to use snmpget to reach one of my extension agent objects:

To do that I first got the object OID using snmptranslate:
snmptranslate -On x-MIB::adeSensorsTable.aDESensorsEntry.vrms
and got:

.1.3.6.1.4.1.43905.1.1.1.1.2

I then ran:
snmpget -v 1 -c public localhost:1161 .1.3.6.1.4.1.43905.1.1.1.1.2

It returns:
Timeout: No Response from localhost:1161.

-
Back on the 1st terminal where my snmp extension agent binary is running,
adeSensorsTable, I have :

Connection from UDP: [127.0.0.1]:55176-[127.0.0.1]
Connection from UDP: [127.0.0.1]:55176-[127.0.0.1]
Connection from UDP: [127.0.0.1]:55176-[127.0.0.1]
Connection from UDP: [127.0.0.1]:55176-[127.0.0.1]
Connection from UDP: [127.0.0.1]:55176-[127.0.0.1]

I'm stumped here!  I'd appreciate if you someone can provide some pointers
on this.  Thanks in advance!
--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders