Thanks to all that replied to my first SNMP script question. Well I
have tweaked the script and it works fine, but now I need to filter
the result. When I run the script I can see all of the ip addresses
connected to the remote servers ports, but I only care about one
address in particular. I aslo only need to know how many established
connections from this ip address there are. Basically I only need a
count of the instances of the ip address that are returned. Here is my
code.

Note, if you want to test this, you need to install the wmi snmp
provider on your workstation.
The area I 'm having difficulty with is near the end witht he For Each
line. I believe this is the area I need to focus on with the filter
function, or maybe I can perform something other than a "for each"
loop?
I have not figured out how to only request specific data, kind of like
an is, or equals statement. So I only get the ip address and the
count, with the count staement I guess?

One more thing, did I end the script correctly?

On Error Resume Next
Set objArgs = Wscript.Arguments
If objArgs.Count < 1 Then
MsgBox ("Syntax is : scriptname.vbs <Machine name> or <IP Address>")
Wscript.Quit 0
End If
strTargetSnmpDevice = objArgs(0)

Set objWmiLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWmiServices = objWmiLocator.ConnectServer("",
"root\snmp\localhost")
Set objWmiNamedValueSet =
CreateObject("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress", strTargetSnmpDevice
objWmiNamedValueSet.Add "AgentReadCommunityName", "public"
Set colTcpConnTable = _
objWmiServices.InstancesOf("SNMP_RFC1213_MIB_tcpConnTable", , _
objWmiNamedValueSet)
Set colUdpTable = _
objWmiServices.InstancesOf("SNMP_RFC1213_MIB_udpTable", , _
objWmiNamedValueSet)

'WScript.Echo "TCP Connections and Listening Ports" & vbCrLf & _
' "-----------------------------------"
For Each objTcpConn In colTcpConnTable
WScript.Echo objTcpConn.tcpConnRemAddress & ":" & _
"[State: " & objTcpConn.tcpConnState & "]"
Next


Also using the same script, there is another issue.

Script purpose: Using the WMISNMP provider, remotely request tcp
connection data, and return the results of onlya specific ip address.

Problem: I cannot figure out the cleanest way to only request the data
I need. Since I know what the ip address should be, I do not care
about any other results the script may return. I only need the ip
address, for example, 10.10.1.1, regardless of any other addresses it
might find.

Script code: Sanatized for safety.

strTargetSnmpDevice = "127.0.0.1"
Set objWmiLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWmiServices = objWmiLocator.ConnectServer("",
"root\snmp\localhost")
Set objWmiNamedValueSet =
CreateObject("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress", strTargetSnmpDevice
objWmiNamedValueSet.Add "AgentReadCommunityName", "public"
Set colTcpConnTable = _
objWmiServices.InstancesOf("SNMP_RFC1213_MIB_tcpConnTable", , _
objWmiNamedValueSet)
Set colUdpTable = _
objWmiServices.InstancesOf("SNMP_RFC1213_MIB_udpTable", , _
objWmiNamedValueSet)

'WScript.Echo "TCP Connections and Listening Ports" & vbCrLf & _
' "-----------------------------------"
For Each objTcpConn In colTcpConnTable
WScript.Echo objTcpConn.tcpConnRemAddress & ":" & _
"[State: " & objTcpConn.tcpConnState & "]"
Next
WScript.Echo vbCrLf & "UDP Ports" & vbCrLf & "---------"
For Each objUdp In colUdpTable
WScript.Echo objUdp.udpLocalAddress & ":" & objUdp.UdpLocalPort
Next

Get Runts and Giants statistic by schmotzli

schmotzli
Fri Feb 27 02:26:03 CST 2004

Hello together! I try to pick on a 3500 SWITCHES error statistics suc
as Runts and Giants. With the script above I approach however not t
the values

I would be very grateful