Hello,
I am trying to get a SNMP v3 GET (with auth and priv) working using snmp4j in code, but I am being unsuccessful. I am therefore trying to prove that snmp4j is usable for this use case. So I am trying the dist jar on the command line.
As you can see below it is not working, can anyone suggest what I may be missing?
I have included the output from another snmpget tool which returns the correct value without issue.
Thanks!
java -jar snmp4j-3.7.4.jar -A auth_password -Y priv_password -u username -v 3 -a MD5 -y DES get udp:192.168.1.9/161 1.3.6.1.4.1.1729.300.2.1.1.2.388
2022-11-25 14:00:45.921 DefaultUDPTransportMapping_0.0.0.0/50323 WARN Cannot convert password to key because authentication protocol '1.3.6.1.6.3.10.1.1.2' not found in authProtocols={1.3.6.1.6.3.10.1.1.7=org.snmp4j.security.AuthHMAC384SHA512@6c2ec54d, 1.3.6.1.6.3.10.1.1.6=org.snmp4j.security.AuthHMAC256SHA384@29eed8, 1.3.6.1.6.3.10.1.1.5=org.snmp4j.security.AuthHMAC192SHA256@7020ee00, 1.3.6.1.6.3.10.1.1.4=org.snmp4j.security.AuthHMAC128SHA224@7c06fd4d}
2022-11-25 14:00:45.930 DefaultUDPTransportMapping_0.0.0.0/50323 WARN Cannot convert password to key because authentication protocol '1.3.6.1.6.3.10.1.1.2' not found in authProtocols={1.3.6.1.6.3.10.1.1.7=org.snmp4j.security.AuthHMAC384SHA512@6c2ec54d, 1.3.6.1.6.3.10.1.1.6=org.snmp4j.security.AuthHMAC256SHA384@29eed8, 1.3.6.1.6.3.10.1.1.5=org.snmp4j.security.AuthHMAC192SHA256@7020ee00, 1.3.6.1.6.3.10.1.1.4=org.snmp4j.security.AuthHMAC128SHA224@7c06fd4d}
2022-11-25 14:00:45.950 DefaultUDPTransportMapping_0.0.0.0/50323 ERROR Failed to send message to UserTarget[address=192.168.1.9/161,version=3,timeout=5000,retries=0,securityLevel=3,securityModel=3,securityName=username,preferredTransports=null, authoritativeEngineID=, securityLevel=3]: Message processing model 3 returned error: Unsupported security level
Received response after 5005 millis
Request timed out.
C:\Users\Administrator\Desktop\SnmpGet>snmpget -r:192.168.1.9 -p:161 -o:1.3.6.1.4.1.1729.300.2.1.1.2.388 -aw:auth_password -pw:priv_password -sn:username -v:3 -ap:MD5 -pp:DES
SnmpGet v1.01 - Copyright (C) 2009 SnmpSoft Company
[ More useful network tools on http://www.snmpsoft.com ]
OID=.1.3.6.1.4.1.1729.300.2.1.1.2.388
Type=OctetString
Value=Test_Value