Class Net::Ping::WMI
In: lib/net/ping/wmi.rb
Parent: Ping

The Ping::WMI class encapsulates the Win32_PingStatus WMI class for MS Windows.

Methods

ping   ping?  

Constants

PingStatus = Struct.new( 'PingStatus', :address, :buffer_size, :no_fragmentation, :primary_address_resolution_status, :protocol_address, :protocol_address_resolved, :record_route, :reply_inconsistency, :reply_size, :resolve_address_names, :response_time, :response_time_to_live, :route_record, :route_record_resolved, :source_route, :source_route_type, :status_code, :timeout, :timestamp_record, :timestamp_record_address, :timestamp_record_address_resolved, :timestamp_route, :time_to_live, :type_of_service

Public Instance methods

Unlike the ping method for other Ping subclasses, this version returns a PingStatus struct which contains various bits of information about the results of the ping itself, such as response time.

In addition, this version allows you to pass certain options that are then passed on to the underlying WQL query. See the MSDN documentation on Win32_PingStatus for details.

Examples:

 # Ping with no options
 Ping::WMI.ping('www.perl.com')

 # Ping with options
 Ping::WMI.ping('www.perl.com', :BufferSize => 64, :NoFragmentation => true)

Unlike Net::Ping::WMI#ping, this method returns true or false to indicate whether or not the ping was successful.

[Validate]