I am trying to get Net-SNMP to give me its configured snmpEngineID even though it looks like it's in there, but I cannot access anything in the snmpV2 MIB.
I have a CentOS 7 server on which I have installed Net-SNMP from the RHeL repos and I need to set it up so that remote management servers can monitor it using SNMPv3, for which I need the snmpEngineID.
The installation went fine and the daemon is working properly:
# snmpwalk -v 2c -c public localhost system.sysContact
SNMPv2-MIB::sysContact.0 = STRING: Martin <wardmw@gmail.com>
#
However, when I try to retrieve the snmpEngineID it fails:
# snmpwalk -v 2c -c public localhost SNMP-FRAMEWORK-MIB::snmpEngineID
SNMP-FRAMEWORK-MIB::snmpEngineID = No more variables left in this MIB View (It is past the end of the MIB tree)
#
On doing a full debug (-D all) of the snmpget command I was provided with the follow:
...
trace: snmp_parse_var_op(): snmp.c, 164:
dumph_recv: Name
dumpx_recv: 06 0A 2B 06 01 06 03 0A 02 01 01 00
dumpv_recv: ObjID: SNMP-FRAMEWORK-MIB::snmpEngineID.0
trace: snmp_pdu_parse(): snmp_api.c, 4530:
dumph_recv: Value
trace: _sess_process_packet(): snmp_api.c, 5245:
sess_process_packet: received message id#0 reqid#1594114350 len 45
trace: snmp_synch_input(): snmp_client.c, 183:
snmp_synch: Response (ReqID: 1594114350 - Cmd 162)
SNMP-FRAMEWORK-MIB::snmpEngineID.0 = No Such Object available on this agent at this OID
#
Even though the snmpwalk() should have worked I tried a direct snmpget() to the objID provided in the output:
# snmpget -v 2c -c public localhost ObjID: SNMP-FRAMEWORK-MIB::snmpEngineID.0
MIB search path: /usr/local/nom/share/snmp/mibs:/usr/local/nom/share/snmp/mibs
Cannot find module (ObjID): At line 0 in (none)
ObjID:: Unknown Object Identifier
#
As you can see this failed as well.
I think that "06 0A 2B 06 01 06 03 0A 02 01 01 00" provided in the debug output is the actual engine ID but I do't want to take that as gospel and, more importantly, I want to know why the snmpwalk and snmpget commands I am trying are failing.
I did try the OID itself, in case there were issues with the MIB file but it also failed:
# snmpget -v 2c -c public localhost .1.3.6.1.6.3.10.2.1.1.0
SNMP-FRAMEWORK-MIB::snmpEngineID.0 = No Such Object available on this agent at this OID
#
I then tried working back through the OID, walking each number. They all failed until I got to to .1.3.6.1
# snmpwalk -v 2c -c public localhost .1.3.6.1.6 | head -1
SNMPv2-SMI::snmpV2 = No more variables left in this MIB View (It is past the end of the MIB tree)
# snmpwalk -v 2c -c public localhost .1.3.6.1 | head -1
SNMPv2-MIB::sysDescr.0 = STRING: Linux 143-42-69-251.ip.linodeusercontent.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
#
.1.3.6.1.6 is the snmpV2-SMI MIB but I am at a loss to understand why this MIB is not being reported back on.
Has anyone come across this? I'm guessing it's something basic, but I certainly cannot see what or where that might be.
Your assistance is much appreciated.