gav_jackson
asked on
c# WMI SNMP retrieve network printers, switches, unix?
I know how to use WMI to query the various Win32_xxxx classes out there and retrieve information from windows OS machines, and i *think* it's possible to query SNMP in a similar way to retrieve information about various SNMP enabled devices on a network, such as printers and switches and possibly even unix machines.
I've been searching around on the internet but cannot find any information on how to achieve this, does anyone know?
sample code would be much appreicated, cheers.
(i'll offer all my remaining points on this one, although i know its not really enough - soz)
I've been searching around on the internet but cannot find any information on how to achieve this, does anyone know?
sample code would be much appreicated, cheers.
(i'll offer all my remaining points on this one, although i know its not really enough - soz)
ASKER
ok
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
keep your points and request that this question be deleted.
.NET does not have any native classes or namespaces that allows you to access SNMP directly (the system.Management class only uses WMI). Go to microsoft.com and query SNMP there. They have some tutorials and such, but it's all for C++.
The problem with SNMP is that it requires DCOM objects, which are basically distributed DLLs. You can try to use DLLImport("snmp32.dll") and then create your own wrappers, but SNMP DLLS have their own memory management and what not, so even those most basic queries (get IP Address) requires a lot of effort.
In short, if you really want to do SNMP, use C++ or hope that MS includes SNMP in .net 2.0