SNMPGET Test From SNMP Client
If you configure the vSPhere SNMP agent for polling, it can listen for and respond to requests from SNMP management client systems, such as GET requests.
By default, the embedded SNMP agent listens on UDP port 161 for polling requests from management systems. You can use the esxcli system snmp set --port command to configure an alternative port.
To avoid conflicting with other services, use a UDP port that is not defined in /etc/services on the vSphere host
Test Configuration
Execute the following command from the SNMP client:
# snmpget -v1 -c private 192.168.0.1 ifName.1
Or
# snmpget -v2c -c private 192.168.0.1 ifName.1
Result
Expected Result from SNMP Client
The following information is expected at SNMP client when executing snmpget:
IF-MIB::ifName.1 = STRING: vmnic0
Expected Result from syslog.log
The following information is logged in /var/log/syslog.log when executing snmpget:
2013-05-21T06:51:05Z snmpd: snmpd: ReceiveFromIpTransport: recvfrom(fd=5, length=2048) rc = 47
2013-05-21T06:51:05Z snmpd: snmpd: snmp_main: rx packet size=47 from: 192.168.0.200:32770
2013-05-21T06:51:05Z snmpd: snmpd: SrDoSnmp: received get pdu
2013-05-21T06:51:05Z snmpd: snmpd: CheckClassMIBView: all included
2013-05-21T06:51:05Z snmpd: snmpd: SrCheckMIBView: MIB view "All" contains the OID"1.3.6.1.2.1.31.1.1.1.1.1"
2013-05-21T06:51:05Z snmpd: snmpd: Searching for requested instance of ifName
2013-05-21T06:51:05Z snmpd: snmpd: SendToIpTransport: sendto(fd=5, length=53) rc = 53
Expected Result from tcpdump
The following tcpdump information is logged when executing snmpget:
~ # tcpdump-uw -v -i vmk0 -n -T snmp udp and port 161
tcpdump-uw: listening on vmk0, link-type EN10MB (Ethernet), capture size 96 bytes
06:51:05.890519 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 75)
192.168.0.200.32770 > 192.168.0.1.161: { SNMPv2c C=private { GetRequest(31) R=1614696227 .1.3.6.1.2.1.31.1.1.1.1.1 } }
06:51:05.891586 IP (tos 0x0, ttl 64, id 53169, offset 0, flags [none], proto UDP (17), length 81)
192.168.0.1.161 > 192.168.0.200.32770: { SNMPv2c C=private { GetResponse(37) R=1614696227 .1.3.6.1.2.1.31.1.1.1.1.1="vmnic0" } }
Result from WireShark
The following information is delivered at the wireshark monitor when executing snmpget:Two items of information are expected when executing snmpget.
The first is the get-Request from the SNMP Client to the vSphere SNMP Agent and the second is the get-Response from the vSphere SNMP Agent to the SNMP Client.
Get-Request
Get-Response