Microsoft Operations Manager

Ping Method

The Pingmethod pings the specified host and measures the response time.

[VBScript] INet.Ping(Address String, Data
Variant, RoundTripMs Variant, [TimeOut Variant])

Parameters

Address
Specifies the destination of the ping request.
Data
Contains the data to send in the request.
RoundTripMs
Number of milliseconds elapsed between sending the request and receiving the reply.
TimeOut
Time-out value for the ping request.

Return Value

Boolean

Examples

The following example shows how to ping the www.microsoft.com server, raising an alert if the ping fails or it takes longer than 500 milliseconds.

[VBScript] 
Dim objINet
Dim blnOK, lngRoundTripMs
Dim strData, strError

Set objINet = CreateObject("OpScrUtil.INet")

blnOK = objINet.Ping("www.microsoft.com", strData, lngRoundTripMs)

If (blnOK) Then
	If (lngRoundTripMs > 500) Then
		'Raise an alert
	End If
Else
	strError = objINet.GetError()
	'Create an alert
End If

Set objINet = Nothing

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

INet Object


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.