Skip to content

jibi/multipinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

multipinger

Ping hosts and do things.

Simple Usage

Add multipinger to your Gemfile:

gem 'multipinger', github: 'jibi/multipinger'

and use it:

require 'multipinger'

PingerRunner.single_runner('name') do
  host 'my_host'
  probe_interval 10
  cooldown 600

  on_up do
    puts 'Host went up'
  end

  is_up do
    puts 'Host is up'
  end

  on_down do
    puts 'Host went down'
  end

  is_down do
    puts 'Host is down'
  end
end

Multiple pingers

If you want to run multiple pingers:

require 'multipinger'

p1 = Pinger.new('..') do
  # ..
end

p2 = Pinger.new('..') do
  # ..
end

r = PingerRunner.new
r.add(p1, p2).run

About

Ping hosts and do things

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages