-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winExtDLL doesn't return any values on system #388
Comments
Does the conversation in #383 provide the information that you are looking for? |
Hi @rhermsen, do you get any value when you are not loading the Win DLLs? Whether you do or do not load the Win DLL, you should always get an output from querying the sysDescr.0 OID according to section "Enabling the Windows SNMP extension agents" in the README.Win32 file. Just keep in mind I am not an expert, so feel free to ignore my comments 😅 |
Bart, Claudio, I didn't find a solution in #383 With NET-SNMP (snmpd -register) I do get the following output: With MS SNMP (stopped NET-SNMP agent, start MS SNMP Service): With NET-SNMP excluding system MIB (snmpd -register -I-udp,udpTable,tcp,tcpTable,icmp,ip,interfaces,system_mib,sysORTable): I do get response from other OID's, just not for the System MIB.
Which does include HOST-RESOURCES-MIB that I understood from README.Win32 must come from the MS DLL according the following:
Btw, for me it took a bit more effort to get MS SNMP installed.
[1] Build steps:
So my Windows build system is not the same as the Windows system where I use NET-SNMP. |
I did some testing on my own system. When I run
When I run
When I run
My testing confirms what you experience and suggests that the If you run |
@rhermsen I did some more research and it looks like the mib-2 system section is skipped on Win Vista and later, see code here @bvanassche should the README be improved or is it possible to attempt and read this information somehow? |
Thanks for looking (digging) further.
starting the NET-SNMP agent indeed gives the output from the NET-SNMP system-mib modules.
The readme also mentions that the Net-SNMP "modules take precedence over the modules loaded by winExtDLL". |
I can confirm that the issue has to do with this if statement. I brutally modified the code so that the
The NetSNMP software was built and tested on Win 10 build 19041. |
According the comment in the code "all queries in that section fail with status "generic error"". |
Commit 59b4d40 ("CHANGES: Windows: Make winExtDLL work on 64-bit Windows systems") caused snmpd to skip MIB-II on 64-bit systems. Revert that change such that the Windows MIB-II implementation can be used on Windows 10. See also: * #383 * #388 With this patch applied, I see the following output in a Windows VM: $ /c/usr/bin/snmpwalk -v2c -cpublic localhost .1.3.6.1.2.1.2 IF-MIB::ifNumber.0 = INTEGER: 9 IF-MIB::ifIndex.1 = INTEGER: 1 IF-MIB::ifIndex.2 = INTEGER: 2 IF-MIB::ifIndex.3 = INTEGER: 3 IF-MIB::ifIndex.4 = INTEGER: 4 IF-MIB::ifIndex.5 = INTEGER: 5 IF-MIB::ifIndex.6 = INTEGER: 6 IF-MIB::ifIndex.7 = INTEGER: 7 IF-MIB::ifIndex.8 = INTEGER: 8 IF-MIB::ifIndex.9 = INTEGER: 9 IF-MIB::ifDescr.1 = STRING: Software Loopback Interface 1 IF-MIB::ifDescr.2 = STRING: Microsoft 6to4 Adapter IF-MIB::ifDescr.3 = STRING: Microsoft Kernel Debug Network Adapter IF-MIB::ifDescr.4 = STRING: Microsoft IP-HTTPS Platform Adapter IF-MIB::ifDescr.5 = STRING: Intel(R) 82574L Gigabit Network Connection IF-MIB::ifDescr.6 = STRING: Microsoft Teredo Tunneling Adapter IF-MIB::ifDescr.7 = STRING: Intel(R) 82574L Gigabit Network Connection-WFP Native MAC Layer LightWeight Filter-0000 IF-MIB::ifDescr.8 = STRING: Intel(R) 82574L Gigabit Network Connection-QoS Packet Scheduler-0000 IF-MIB::ifDescr.9 = STRING: Intel(R) 82574L Gigabit Network Connection-WFP 802.3 MAC Layer LightWeight Filter-0000 IF-MIB::ifType.1 = INTEGER: softwareLoopback(24) IF-MIB::ifType.2 = INTEGER: tunnel(131) IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6) IF-MIB::ifType.4 = INTEGER: tunnel(131) IF-MIB::ifType.5 = INTEGER: ethernetCsmacd(6) IF-MIB::ifType.6 = INTEGER: tunnel(131) IF-MIB::ifType.7 = INTEGER: ethernetCsmacd(6) IF-MIB::ifType.8 = INTEGER: ethernetCsmacd(6) IF-MIB::ifType.9 = INTEGER: ethernetCsmacd(6) IF-MIB::ifMtu.1 = INTEGER: 1500 IF-MIB::ifMtu.2 = INTEGER: 0 IF-MIB::ifMtu.3 = INTEGER: 0 IF-MIB::ifMtu.4 = INTEGER: 0 IF-MIB::ifMtu.5 = INTEGER: 1500 IF-MIB::ifMtu.6 = INTEGER: 0 IF-MIB::ifMtu.7 = INTEGER: 1500 IF-MIB::ifMtu.8 = INTEGER: 1500 IF-MIB::ifMtu.9 = INTEGER: 1500 IF-MIB::ifSpeed.1 = Gauge32: 1073741824 IF-MIB::ifSpeed.2 = Gauge32: 0 IF-MIB::ifSpeed.3 = Gauge32: 0 IF-MIB::ifSpeed.4 = Gauge32: 0 IF-MIB::ifSpeed.5 = Gauge32: 1000000000 IF-MIB::ifSpeed.6 = Gauge32: 0 IF-MIB::ifSpeed.7 = Gauge32: 1000000000 IF-MIB::ifSpeed.8 = Gauge32: 1000000000 IF-MIB::ifSpeed.9 = Gauge32: 1000000000 IF-MIB::ifPhysAddress.1 = STRING: IF-MIB::ifPhysAddress.2 = STRING: IF-MIB::ifPhysAddress.3 = STRING: IF-MIB::ifPhysAddress.4 = STRING: IF-MIB::ifPhysAddress.5 = STRING: 52:54:0:bb:6f:2f IF-MIB::ifPhysAddress.6 = STRING: IF-MIB::ifPhysAddress.7 = STRING: 52:54:0:bb:6f:2f IF-MIB::ifPhysAddress.8 = STRING: 52:54:0:bb:6f:2f IF-MIB::ifPhysAddress.9 = STRING: 52:54:0:bb:6f:2f IF-MIB::ifAdminStatus.1 = INTEGER: up(1) IF-MIB::ifAdminStatus.2 = INTEGER: down(2) IF-MIB::ifAdminStatus.3 = INTEGER: down(2) IF-MIB::ifAdminStatus.4 = INTEGER: down(2) IF-MIB::ifAdminStatus.5 = INTEGER: up(1) IF-MIB::ifAdminStatus.6 = INTEGER: down(2) IF-MIB::ifAdminStatus.7 = INTEGER: up(1) IF-MIB::ifAdminStatus.8 = INTEGER: up(1) IF-MIB::ifAdminStatus.9 = INTEGER: up(1) IF-MIB::ifOperStatus.1 = INTEGER: up(1) IF-MIB::ifOperStatus.2 = INTEGER: down(2) IF-MIB::ifOperStatus.3 = INTEGER: down(2) IF-MIB::ifOperStatus.4 = INTEGER: down(2) IF-MIB::ifOperStatus.5 = INTEGER: up(1) IF-MIB::ifOperStatus.6 = INTEGER: down(2) IF-MIB::ifOperStatus.7 = INTEGER: up(1) IF-MIB::ifOperStatus.8 = INTEGER: up(1) IF-MIB::ifOperStatus.9 = INTEGER: up(1) IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.2 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.3 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.4 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.5 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.6 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.7 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.8 = Timeticks: (0) 0:00:00.00 IF-MIB::ifLastChange.9 = Timeticks: (0) 0:00:00.00 IF-MIB::ifInOctets.1 = Counter32: 0 IF-MIB::ifInOctets.2 = Counter32: 0 IF-MIB::ifInOctets.3 = Counter32: 0 IF-MIB::ifInOctets.4 = Counter32: 0 IF-MIB::ifInOctets.5 = Counter32: 3902284436 IF-MIB::ifInOctets.6 = Counter32: 0 IF-MIB::ifInOctets.7 = Counter32: 3902284436 IF-MIB::ifInOctets.8 = Counter32: 3902284436 IF-MIB::ifInOctets.9 = Counter32: 3902284436 IF-MIB::ifInUcastPkts.1 = Counter32: 0 IF-MIB::ifInUcastPkts.2 = Counter32: 0 IF-MIB::ifInUcastPkts.3 = Counter32: 0 IF-MIB::ifInUcastPkts.4 = Counter32: 0 IF-MIB::ifInUcastPkts.5 = Counter32: 265150678 IF-MIB::ifInUcastPkts.6 = Counter32: 0 IF-MIB::ifInUcastPkts.7 = Counter32: 265150678 IF-MIB::ifInUcastPkts.8 = Counter32: 265150678 IF-MIB::ifInUcastPkts.9 = Counter32: 265150678 IF-MIB::ifInNUcastPkts.1 = Counter32: 0 IF-MIB::ifInNUcastPkts.2 = Counter32: 0 IF-MIB::ifInNUcastPkts.3 = Counter32: 0 IF-MIB::ifInNUcastPkts.4 = Counter32: 0 IF-MIB::ifInNUcastPkts.5 = Counter32: 28 IF-MIB::ifInNUcastPkts.6 = Counter32: 0 IF-MIB::ifInNUcastPkts.7 = Counter32: 28 IF-MIB::ifInNUcastPkts.8 = Counter32: 28 IF-MIB::ifInNUcastPkts.9 = Counter32: 28 IF-MIB::ifInDiscards.1 = Counter32: 0 IF-MIB::ifInDiscards.2 = Counter32: 0 IF-MIB::ifInDiscards.3 = Counter32: 0 IF-MIB::ifInDiscards.4 = Counter32: 0 IF-MIB::ifInDiscards.5 = Counter32: 0 IF-MIB::ifInDiscards.6 = Counter32: 0 IF-MIB::ifInDiscards.7 = Counter32: 0 IF-MIB::ifInDiscards.8 = Counter32: 0 IF-MIB::ifInDiscards.9 = Counter32: 0 IF-MIB::ifInErrors.1 = Counter32: 0 IF-MIB::ifInErrors.2 = Counter32: 0 IF-MIB::ifInErrors.3 = Counter32: 0 IF-MIB::ifInErrors.4 = Counter32: 0 IF-MIB::ifInErrors.5 = Counter32: 0 IF-MIB::ifInErrors.6 = Counter32: 0 IF-MIB::ifInErrors.7 = Counter32: 0 IF-MIB::ifInErrors.8 = Counter32: 0 IF-MIB::ifInErrors.9 = Counter32: 0 IF-MIB::ifInUnknownProtos.1 = Counter32: 0 IF-MIB::ifInUnknownProtos.2 = Counter32: 0 IF-MIB::ifInUnknownProtos.3 = Counter32: 0 IF-MIB::ifInUnknownProtos.4 = Counter32: 0 IF-MIB::ifInUnknownProtos.5 = Counter32: 0 IF-MIB::ifInUnknownProtos.6 = Counter32: 0 IF-MIB::ifInUnknownProtos.7 = Counter32: 0 IF-MIB::ifInUnknownProtos.8 = Counter32: 0 IF-MIB::ifInUnknownProtos.9 = Counter32: 0 IF-MIB::ifOutOctets.1 = Counter32: 0 IF-MIB::ifOutOctets.2 = Counter32: 0 IF-MIB::ifOutOctets.3 = Counter32: 0 IF-MIB::ifOutOctets.4 = Counter32: 0 IF-MIB::ifOutOctets.5 = Counter32: 1952733666 IF-MIB::ifOutOctets.6 = Counter32: 0 IF-MIB::ifOutOctets.7 = Counter32: 1952733666 IF-MIB::ifOutOctets.8 = Counter32: 1952733666 IF-MIB::ifOutOctets.9 = Counter32: 1952733666 IF-MIB::ifOutUcastPkts.1 = Counter32: 0 IF-MIB::ifOutUcastPkts.2 = Counter32: 0 IF-MIB::ifOutUcastPkts.3 = Counter32: 0 IF-MIB::ifOutUcastPkts.4 = Counter32: 0 IF-MIB::ifOutUcastPkts.5 = Counter32: 137686780 IF-MIB::ifOutUcastPkts.6 = Counter32: 0 IF-MIB::ifOutUcastPkts.7 = Counter32: 137686780 IF-MIB::ifOutUcastPkts.8 = Counter32: 137686780 IF-MIB::ifOutUcastPkts.9 = Counter32: 137686780 IF-MIB::ifOutNUcastPkts.1 = Counter32: 0 IF-MIB::ifOutNUcastPkts.2 = Counter32: 0 IF-MIB::ifOutNUcastPkts.3 = Counter32: 0 IF-MIB::ifOutNUcastPkts.4 = Counter32: 0 IF-MIB::ifOutNUcastPkts.5 = Counter32: 115 IF-MIB::ifOutNUcastPkts.6 = Counter32: 0 IF-MIB::ifOutNUcastPkts.7 = Counter32: 115 IF-MIB::ifOutNUcastPkts.8 = Counter32: 115 IF-MIB::ifOutNUcastPkts.9 = Counter32: 115 IF-MIB::ifOutDiscards.1 = Counter32: 0 IF-MIB::ifOutDiscards.2 = Counter32: 0 IF-MIB::ifOutDiscards.3 = Counter32: 0 IF-MIB::ifOutDiscards.4 = Counter32: 0 IF-MIB::ifOutDiscards.5 = Counter32: 0 IF-MIB::ifOutDiscards.6 = Counter32: 0 IF-MIB::ifOutDiscards.7 = Counter32: 0 IF-MIB::ifOutDiscards.8 = Counter32: 0 IF-MIB::ifOutDiscards.9 = Counter32: 0 IF-MIB::ifOutErrors.1 = Counter32: 0 IF-MIB::ifOutErrors.2 = Counter32: 0 IF-MIB::ifOutErrors.3 = Counter32: 0 IF-MIB::ifOutErrors.4 = Counter32: 0 IF-MIB::ifOutErrors.5 = Counter32: 0 IF-MIB::ifOutErrors.6 = Counter32: 0 IF-MIB::ifOutErrors.7 = Counter32: 0 IF-MIB::ifOutErrors.8 = Counter32: 0 IF-MIB::ifOutErrors.9 = Counter32: 0 IF-MIB::ifOutQLen.1 = Gauge32: 0 IF-MIB::ifOutQLen.2 = Gauge32: 0 IF-MIB::ifOutQLen.3 = Gauge32: 0 IF-MIB::ifOutQLen.4 = Gauge32: 0 IF-MIB::ifOutQLen.5 = Gauge32: 0 IF-MIB::ifOutQLen.6 = Gauge32: 0 IF-MIB::ifOutQLen.7 = Gauge32: 0 IF-MIB::ifOutQLen.8 = Gauge32: 0 IF-MIB::ifOutQLen.9 = Gauge32: 0 IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.4 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.5 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.6 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.7 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.8 = OID: SNMPv2-SMI::zeroDotZero IF-MIB::ifSpecific.9 = OID: SNMPv2-SMI::zeroDotZero
@janclod I just tried the same (sed -i 's(s_versioninfo.dwMajorVersion >= 6(5 >= 6\g' /home/rhermsen/workdir/net-snmp/net-snmp-5.9.1/agent/mibgroup/winExtDLL.c)
And it is now using the MS SNMP MIB: I do get an error if I perform a walk for the whole tree.
|
Multiple fixes have been checked in on the v5.9 and master branches. Please help with testing these fixes. |
@bvanassche |
Hmm ... in the document https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa I found that dwMajorVersion == 10 for Windows 10. Anyway, the |
Just checked to be sure, I compiled on Windows 10 Pro version 1909 build 18363.1556 |
Nice to see the effort and progress :)
@bvanassche I took some time to review your commits (also related to the documentation) and everything now works (important to exclude the
Tested on The NetSNMP was built from branch
...
@bvanassche @rhermsen yes Win10 major version can be |
Also confirm that with commit 17759ba I can query the system mib.
I don't see an error, and get more results back.
Thanks both @bvanassche and @janclod |
I can reproduce the
This is what appears in the snmpd log if I run the above command:
I think the above indicates a bug in the Microsoft DLL |
Glad to see that the issue is resolved :) @bvanassche I got the same error on Win 10
This error disappeared when I tested a second time, is it possible that the error is not always happening? Would it be possible to isolate the instances when the error occurs? |
Hmm ... on my setup the error does not disappear if I repeatedly access sysDescr.0 (using a MinGW shell):
|
If I run snmpd from cmd prompt a query of the system description works for me: Server:
Client:
But indeed if I run snmpd from within a msys shell it also gives this error.
client:
This is on the Win10 PC where I compiled this on. (Last compile step was dynamic): |
Just to be extra sure I did also re-test on Win 10 and it works fine on my machine. NetSNMP build using commit bd7394d (V5-9-patches branch) with the following options
Testing from the prompt command snmpd output
snmpget output
@bvanassche let us know if any info from out side can help you troubleshoot :) |
Hi there, is this issue still unresolved? I start SNMPd using this commandline: And then I try to snmpget sysDescr.0:
SNMPd then writes the following to the log:
|
SNMP agent doesn't return any value when using windows dlls.
Trying to get sysDescr.0 return an error "No Such Object available on this agent at this OID".
Get the following output when enabling winExtDLL with debug enabled:
Windows 10 x64
VC++ 2017 x64
OpenSSL 1.1.1l
perl-5.32.1 built with VC++ 2017 x64
Net-SNMP 5.9.1 built with:
perl Configure --with-sdk --with-winextdll --with-ssl --with-ipv6 --config=release --linktype=static --prefix="c:/usr"
nmake
nmake install
The text was updated successfully, but these errors were encountered: