Agent++-4.6.1 cannot compile with SNMP++-3.5.2

Hi,

I could make SNMP+±3.5.2 sucessful. However, I could not cmake Agent+±4.6.1 using libsnmp++ of SNMP+±3.5.2. There are some compiled errors for examples such as #error “_SNMPv3 must be defined in order to use the ProxyForwarder”, ‘class Agentpp::RequestList’ has no member named ‘get_v3mp’, ‘class Agentpp::Mib’ has no member named ‘register_proxy’, … , etc. Therefore, I have to modify CMakeLists.txt to turn OFF the OPTION_EXAMPLES to help Agent+±4.6.1 to compile.

Note: I only saw ‘get_mpv3()’ in SNMP+±3.5.2. However, Agent+±4.6.1 src\snmp_pp_ext.cpp used ‘get_mpv3()’ and agenpro/examples/other src used ‘get_v3mp()’.

Please advise.
Thanks,
Phuoc.

Hi Phuoc,
You need to use the same compiler settings for SNMP++ and AGENT++.
You should activate SNMPV3, even if you would like to use the unsafe SNMPv2c or v1 later too.
Best regards,
Frank

Hi Frank,

Thanks for the reply.
I used the same compiler identification GNU 8.5.0
How can I activate SNMPV3?

Thanks,
Phuoc

Hi,

I could active SNMPV3 and compile both SNMP+±3.5.2 and Agent +±4.6.1. However, when I tried to run multi_agent/src/./agent, I got “Segmentation fault, aborting.” Do you have any ideas to help me to troubleshoot this error?

20240715.18:20:07: 140491861653248: (3)INFO : AuthPriv: Added default Auth and Priv protocols.
20240715.18:20:07: 140491861653248: (1)DEBUG : UsmUserTable: add row with index: (20.128.0.19.112.5.111.107.99.45.111.56.54.103.105.116.45.48.49.18.93.12.117.110.115.101.99.117.114.101.85.115.101.114)

Segmentation fault, aborting.

Note: SNMP+±3.5.2 seems like OK
./snmpGet 127.0.0.1 -v3 -P4700
20240715.18:34:15: 140212977796928: (3)DEBUG : getBootCounter: found entry (file) (engine id) (boot counter): (snmpv3_boot_counter), (snmpGet), (8)
20240715.18:34:15: 140212977796928: (5)INFO : saveBootCounter: Saved counter (file) (engine id) (boot): (snmpv3_boot_counter), (snmpGet), (9)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (3)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (4)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (5)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (6)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (7)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added auth protocol (id): (2)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added priv protocol (id): (2)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added priv protocol (id): (4)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added priv protocol (id): (20)
20240715.18:34:15: 140212977796928: (6)INFO : AuthPriv: Added priv protocol (id): (21)
20240715.18:34:15: 140212977796928: (3)INFO : AuthPriv: Added default Auth and Priv protocols.
SNMP++ Get to 127.0.0.1 SNMPV3 Retries=1 Timeout=1000ms
securityName= , securityLevel= 3, securityModel= 3
contextName= , contextEngineID=
20240715.18:34:15: 140212977796928: (4)INFO : v3MP::EngineIdTable: Dont know engine id for (host) (port): (127.0.0.1), (4700)
20240715.18:34:15: 140212977796928: (5)DEBUG : v3MP: Building message with (SecurityEngineID) (securityName) (securityLevel) (contextEngineID) (contextName): (), (), (1), (), ()
20240715.18:34:15: 140212977796928: (3)INFO : v3MP: Message built OK
20240715.18:34:15: 140212977796928: (4)DEBUG : SNMPMessage: return value for build message: (-1401)
20240715.18:34:16: 140212977796928: (4)INFO : v3MP::EngineIdTable: Dont know engine id for (host) (port): (127.0.0.1), (4700)
20240715.18:34:16: 140212977796928: (5)DEBUG : v3MP: Building message with (SecurityEngineID) (securityName) (securityLevel) (contextEngineID) (contextName): (), (), (1), (), ()
20240715.18:34:16: 140212977796928: (3)INFO : v3MP: Message built OK
20240715.18:34:16: 140212977796928: (4)DEBUG : SNMPMessage: return value for build message: (-1401)
20240715.18:34:17: 140212977796928: (6)INFO : MsgQueue: Message timed out, removed id from v3MP cache (rid): (26824)
SNMP++ Get Error, SNMP++: SNMP request timed out (-5)

Please advise.
Thanks,
Phuoc.