Using SNMP via WMI

M

Mark Parter

I'm having extreme difficulty getting SNMP to work via
WMI. I've been trying to get this to work for the last 3
days and am getting no further forward.

I have the following script;

*********************************************************

strTargetSnmpDevice = "10.20.16.*"
strTargetSnmpCommunity = "*****"

Set objWmiLocator = CreateObject
("WbemScripting.SWbemLocator")
Set objWmiServices = objWmiLocator.ConnectServer
("","root\snmp\localhost")

Set objWmiNamedValueSet = CreateObject
("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress",
strTargetSnmpDevice
objWmiNamedValueSet.Add "AgentReadCommunityName",strTarget
SnmpCommunity

Set colSystem = objWmiServices.InstancesOf
("SNMP_RFC1213_MIB_system",, objWmiNamedValueSet)

For Each objSystem In colSystem <--ERROR HERE
MsgBox "sysContact: " & objSystem.sysContact
Next
*********************************************************

I get a 80041010 error on the line indicated above. When
I look in the wbemcore.log file, I see th following
message;
*********************************************************
Class provider 'MS_SNMP_CLASS_PROVIDER' installed in
namespace 'root\snmp\localhost' failed to enumerate
classes, returning error code 0x80041001. Operations will
continue as if the class provider had no classes. This
provider-specific error condition needs to be corrected
before this class provider can contribute to this
namespace.
*********************************************************

I have the SNMP Protocol installed, the SNMP Provider
installed and also the WMI SDK. It's a Windows 2000
Server SP4 machine I'm testing on to talk to a Cisco
router.

Help me please before I go insane :(
 
G

Guest

I am not positive of my answer, but it sounds like the router is at fault. Do a show command on the router and confirm the ports and SNMP are open with the correct user....

Look at Cisco's site for a white paper...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top