[AGENT++] SNMPv3 requests problem

Renato A. Ferreira renatoferreirarenatoferreira at gmail.com
Sun Apr 24 10:32:24 CEST 2016


Hi!

I'm not being able to make SNMPv3 requests using the SNMP++ api. The two 
subsequent requests are all receiving usmStatsUnknownEngineIDs errors. I 
don't think that this error is the real problem because when I'm using 
the snmpWalk it also happens, but the application/api remakes the 
request to move forward instead.

Here is the output:
===================================
20160424.05:15:21: 0: (1)DEBUG  : from inet_ntop: 0.0.0.0
20160424.05:15:21: 0: (1)DEBUG  : Initialized request_id to 1041.
20160424.05:15:21: 0: (1)DEBUG  : from inet_ntop: ::
20160424.05:15:21: 0: (1)DEBUG  : Initialized request_id to 19467.
20160424.05:15:21: 0: (6)INFO   : AuthPriv: Added auth protocol (id): (3)
20160424.05:15:21: 0: (6)INFO   : AuthPriv: Added auth protocol (id): (2)
20160424.05:15:21: 0: (6)INFO   : AuthPriv: Added priv protocol (id): (2)
20160424.05:15:21: 0: (6)INFO   : AuthPriv: Added priv protocol (id): (3)
20160424.05:15:21: 0: (3)INFO   : AuthPriv: Added default Auth and Priv 
protocols.
20160424.05:15:27: 0: (1)DEBUG  : from inet_ntop: 192.168.147.244
20160424.05:15:27: 0: (1)DEBUG  : USM::get_user: user (v3user) engine_id 
(snmpBulk)
20160424.05:15:27: 0: (1)DEBUG  : snmp_engine called with UTarget
20160424.05:15:27: 0: (4)INFO   : v3MP::EngineIdTable: Dont know engine 
id for (host) (port): (192.168.147.244), (161)
20160424.05:15:27: 0: (1)DEBUG  : Setting contextEngineID of Pdu to ()
20160424.05:15:27: 0: (1)DEBUG  : Snmp::snmp_engine: engineID (), 
securityName (v3user)securityModel (3) security_level (3)
20160424.05:15:27: 0: (1)DEBUG  :  Addr/Port (192.168.147.244/161)
20160424.05:15:27: 0: (5)DEBUG  : v3MP: Building message with 
(SecurityEngineID) (securityName) (securityLevel) (contextEngineID) 
(contextName): (), (v3user), (1), (), ()
20160424.05:15:27: 0: (1)DEBUG  : Coding msgID(65536), 
maxMessageSize(0x1000), msgFlags(0x4), securityModel(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (headerdata), length = 0xf
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr 
sp.msgAuthoritativeEngineID, length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding int 
sp.msgAuthoritativeEngineBoots = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding int 
sp.msgAuthoritativeEngineTime = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgUserName, length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgAu..Para.. , 
length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgPr..Para.. , 
length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (securityPar), length 
= 0xe
20160424.05:15:27: 0: (1)DEBUG  : Coding int snmpVersion = 0x3
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr securityParameter, 
length = 0x10
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (wholeMsg), length = 0x3a
20160424.05:15:27: 0: (3)INFO   : v3MP: Message built OK
20160424.05:15:27: 0: (4)DEBUG  : SNMPMessage: return value for build 
message: (-1401)
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: sending to 192.168.147.244/161:
20160424.05:15:27: 0: (3)DEBUG  : 30 3A 02 01  03 30 0F 02  03 01 00 00  
02 02 10 00
20160424.05:15:27: 0: (3)DEBUG  : 04 01 04 02  01 03 04 10  30 0E 04 00  
02 01 00 02
20160424.05:15:27: 0: (3)DEBUG  : 01 00 04 00  04 00 04 00  30 12 04 00  
04 00 A5 0C
20160424.05:15:27: 0: (3)DEBUG  : 02 02 04 12  02 01 00 02  01 0A 30 00
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: something received...
20160424.05:15:27: 0: (1)DEBUG  : Length received 113 from socket 616; 
fromlen 16
20160424.05:15:27: 0: (1)DEBUG  : from inet_ntop: 192.168.147.244
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: data received from 
192.168.147.244/161.
20160424.05:15:27: 0: (3)DEBUG  : 30 6F 02 01  03 30 10 02  03 01 00 00  
02 03 00 FF
20160424.05:15:27: 0: (3)DEBUG  : E3 04 01 00  02 01 03 04  22 30 20 04  
11 80 00 1F
20160424.05:15:27: 0: (3)DEBUG  : 88 80 95 F4  55 69 62 75  B9 55 00 00  
00 00 02 01
20160424.05:15:27: 0: (3)DEBUG  : 15 02 02 1F  D7 04 00 04  00 04 00 30  
34 04 11 80
20160424.05:15:27: 0: (3)DEBUG  : 00 1F 88 80  95 F4 55 69  62 75 B9 55  
00 00 00 00
20160424.05:15:27: 0: (3)DEBUG  : 04 00 A8 1D  02 02 04 12  02 01 00 02  
01 00 30 11
20160424.05:15:27: 0: (3)DEBUG  : 30 0F 06 0A  2B 06 01 06  03 0F 01 01  
04 00 41 01
20160424.05:15:27: 0: (3)DEBUG  : 40
20160424.05:15:27: 0: (1)DEBUG  : mp is parsing incoming message:
20160424.05:15:27: 0: (1)DEBUG  : Parsed length(6c), version(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Parsed HeaderData: 
globalDataLength(0x0), msg_id(65536), msg_max_size(0xffe3), 
msg_flags(0x0), msg_security_model(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Parsed msgdata length(0x36), 
msgSecurityParameters length(0x22)
20160424.05:15:27: 0: (1)DEBUG  : Parsed securityParametersLength = 0x20
20160424.05:15:27: 0: (1)DEBUG  : Parsed securityEngineID, length = 0x11
20160424.05:15:27: 0: (1)DEBUG  : Parsed engineBoots(0x1fd7), 
engineTime(0x15)
20160424.05:15:27: 0: (1)DEBUG  : Parsed usmUserName length(0x0) 
msgAuthenticationParameters length(0x0) msgPrivacyParameters length(0x0)
20160424.05:15:27: 0: (1)DEBUG  : Accepting zero length user/security name.
20160424.05:15:27: 0: (1)DEBUG  : ErrorCode is 0
20160424.05:15:27: 0: (1)DEBUG  : Parsed scoped_pdu: context_engine_id 
length(0x11), context_name length(0x0)
20160424.05:15:27: 0: (1)DEBUG  : *** Receiving a ReportPDU ***
20160424.05:15:27: 0: (1)DEBUG  : mp finished (OK)
20160424.05:15:27: 0: (1)DEBUG  : receive_snmp_response: engine_id (  80 
00 1F 88 80 95 F4 55 69 62 75 B9 55 00 00 00 .......Uibu.U...  00 .), 
security_name (), security_model (3), security_level (1)
20160424.05:15:27: 0: (1)DEBUG  :  addtoengineidtable: (192.168.147.244/161)
20160424.05:15:27: 0: (1)DEBUG  : receive_snmp_response requestID = 
1042, returning SUCCESS.
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: received oid: 
1.3.6.1.6.3.15.1.1.4.0 with value: 64
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: error_msg (SNMPv3: USM: 
Unknown EngineID), pdu_type (168)
20160424.05:15:27: 0: (1)DEBUG  : snmp_engine called with UTarget
20160424.05:15:27: 0: (4)INFO   : v3MP::EngineIdTable: Dont know engine 
id for (host) (port): (192.168.147.244), (161)
20160424.05:15:27: 0: (1)DEBUG  : Setting contextEngineID of Pdu to ()
20160424.05:15:27: 0: (1)DEBUG  : Snmp::snmp_engine: engineID (), 
securityName (v3user)securityModel (3) security_level (3)
20160424.05:15:27: 0: (1)DEBUG  :  Addr/Port (192.168.147.244/161)
20160424.05:15:27: 0: (5)DEBUG  : v3MP: Building message with 
(SecurityEngineID) (securityName) (securityLevel) (contextEngineID) 
(contextName): (), (v3user), (1), (), ()
20160424.05:15:27: 0: (1)DEBUG  : Coding msgID(65537), 
maxMessageSize(0x1000), msgFlags(0x4), securityModel(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (headerdata), length = 0xf
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr 
sp.msgAuthoritativeEngineID, length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding int 
sp.msgAuthoritativeEngineBoots = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding int 
sp.msgAuthoritativeEngineTime = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgUserName, length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgAu..Para.. , 
length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr sp.msgPr..Para.. , 
length = 0x0
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (securityPar), length 
= 0xe
20160424.05:15:27: 0: (1)DEBUG  : Coding int snmpVersion = 0x3
20160424.05:15:27: 0: (1)DEBUG  : Coding octstr securityParameter, 
length = 0x10
20160424.05:15:27: 0: (1)DEBUG  : Coding sequence (wholeMsg), length = 0x3a
20160424.05:15:27: 0: (3)INFO   : v3MP: Message built OK
20160424.05:15:27: 0: (4)DEBUG  : SNMPMessage: return value for build 
message: (-1401)
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: sending to 192.168.147.244/161:
20160424.05:15:27: 0: (3)DEBUG  : 30 3A 02 01  03 30 0F 02  03 01 00 01  
02 02 10 00
20160424.05:15:27: 0: (3)DEBUG  : 04 01 04 02  01 03 04 10  30 0E 04 00  
02 01 00 02
20160424.05:15:27: 0: (3)DEBUG  : 01 00 04 00  04 00 04 00  30 12 04 00  
04 00 A5 0C
20160424.05:15:27: 0: (3)DEBUG  : 02 02 04 13  02 01 00 02  01 0A 30 00
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: snmp_engine called, rc (0)
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: something received...
20160424.05:15:27: 0: (1)DEBUG  : Length received 113 from socket 616; 
fromlen 16
20160424.05:15:27: 0: (1)DEBUG  : from inet_ntop: 192.168.147.244
20160424.05:15:27: 0: (1)DEBUG  : ++ SNMP++: data received from 
192.168.147.244/161.
20160424.05:15:27: 0: (3)DEBUG  : 30 6F 02 01  03 30 10 02  03 01 00 01  
02 03 00 FF
20160424.05:15:27: 0: (3)DEBUG  : E3 04 01 00  02 01 03 04  22 30 20 04  
11 80 00 1F
20160424.05:15:27: 0: (3)DEBUG  : 88 80 95 F4  55 69 62 75  B9 55 00 00  
00 00 02 01
20160424.05:15:27: 0: (3)DEBUG  : 15 02 02 1F  D7 04 00 04  00 04 00 30  
34 04 11 80
20160424.05:15:27: 0: (3)DEBUG  : 00 1F 88 80  95 F4 55 69  62 75 B9 55  
00 00 00 00
20160424.05:15:27: 0: (3)DEBUG  : 04 00 A8 1D  02 02 04 13  02 01 00 02  
01 00 30 11
20160424.05:15:27: 0: (3)DEBUG  : 30 0F 06 0A  2B 06 01 06  03 0F 01 01  
04 00 41 01
20160424.05:15:27: 0: (3)DEBUG  : 41
20160424.05:15:27: 0: (1)DEBUG  : mp is parsing incoming message:
20160424.05:15:27: 0: (1)DEBUG  : Parsed length(6c), version(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Parsed HeaderData: 
globalDataLength(0x0), msg_id(65537), msg_max_size(0xffe3), 
msg_flags(0x0), msg_security_model(0x3)
20160424.05:15:27: 0: (1)DEBUG  : Parsed msgdata length(0x36), 
msgSecurityParameters length(0x22)
20160424.05:15:27: 0: (1)DEBUG  : Parsed securityParametersLength = 0x20
20160424.05:15:27: 0: (1)DEBUG  : Parsed securityEngineID, length = 0x11
20160424.05:15:27: 0: (1)DEBUG  : Parsed engineBoots(0x1fd7), 
engineTime(0x15)
20160424.05:15:27: 0: (1)DEBUG  : Parsed usmUserName length(0x0) 
msgAuthenticationParameters length(0x0) msgPrivacyParameters length(0x0)
20160424.05:15:27: 0: (1)DEBUG  : Accepting zero length user/security name.
20160424.05:15:27: 0: (1)DEBUG  : ErrorCode is 0
20160424.05:15:27: 0: (1)DEBUG  : Parsed scoped_pdu: context_engine_id 
length(0x11), context_name length(0x0)
20160424.05:15:27: 0: (1)DEBUG  : *** Receiving a ReportPDU ***
20160424.05:15:27: 0: (1)DEBUG  : mp finished (OK)
20160424.05:15:27: 0: (1)DEBUG  : receive_snmp_response: engine_id (  80 
00 1F 88 80 95 F4 55 69 62 75 B9 55 00 00 00 .......Uibu.U...  00 .), 
security_name (), security_model (3), security_level (1)
20160424.05:15:27: 0: (1)DEBUG  :  addtoengineidtable: (192.168.147.244/161)
20160424.05:15:27: 0: (1)DEBUG  : receive_snmp_response requestID = 
1043, returning SUCCESS.
20160424.05:15:27: 0: (2)INFO   : v3MP::EngineIdTable: replace entry 
(old id) (old host) (old port) (id) (host) (port): (  80 00 1F 88 80 95 
F4 55 69 62 75 B9 55 00 00 00    .......Uibu.U... 
00                                                 .), 
(192.168.147.244), (0), (  80 00 1F 88 80 95 F4 55 69 62 75 B9 55 00 00 
00    .......Uibu.U... 
00                                                 ., (192.168.147.244), (0)
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: received oid: 
1.3.6.1.6.3.15.1.1.4.0 with value: 65
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: error_msg (SNMPv3: USM: 
Unknown EngineID), pdu_type (168)
20160424.05:15:27: 0: (1)DEBUG  : v3CallBack: calling user callback
===================================

I'm trying to get this working for days. I'm working in this tool: 
https://github.com/renatoferreirarenatoferreira/quickmon

Thank-you!

Renato A. Ferreira


More information about the AGENTPP mailing list