Hi,
can someone pls help and suggest the workaround, when I run the
following code, it return error
require 'rubygems'
require 'net/ping'
class PingIp
def ping_system(ping_system) @ping_address = "ping_system" #result = Ping.pingecho(ip_address,5,80)
result = Net::Ping.ping(@ping_address, 5)
if result
puts "system is alive"
else
puts "system is offline"
end
return result
end
end # end of class
res = pingable?(host, u)
if res[0] #puts "OK: #{res[1]}"
puts "OK: Works fine!"
exit 0
else #puts "Critical: #{res[1]}"
puts "Critical: Has issues!"
exit 1
end #END
hope it helps.
Eliezer
···
On 09/10/2013 07:14 PM, Bal Sidhu wrote:
Hi,
can someone pls help and suggest the workaround, when I run the
following code, it return error
require 'rubygems'
require 'net/ping'
class PingIp
def ping_system(ping_system) @ping_address = "ping_system" #result = Ping.pingecho(ip_address,5,80)
result = Net::Ping.ping(@ping_address, 5)
if result
puts "system is alive"
else
puts "system is offline"
end
return result
end
end # end of class