Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make SNMP queries

Status
Not open for further replies.

lyric0n

Technical User
Dec 28, 2005
74
Hello,

I would like to use VBScript to query a network device with SNMP v1, then walk a particular OID, and then process the data returned. Can I walk an OID with VBScript like this? If so, is there an example?

Thanks,
Chris
 
This isn't the full solution: just the starting point
Code:
strTarget = "10.0.0.1" ' Address of your target device
set objLocator = CreateObject ("WbemScripting.SWbemLocator")
set objServices = objLocator.ConnectServer ("", "root\snmp\localhost")
set objSet = CreateObject ("WbemScripting.SWbemNamedValueSet")
objSet.Add "AgentAddress", strTarget
objSet.Add "AgentReadCommunityName", "public"

' The problem is figuring out what xxx is
set collection = objServices.InstancesOf ("xxx",,objSet)
for each obj in collection
   WScript.echo ...
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top