pinger v1.1.1
pinger
Microlib to generate ICMP ping requests.
Avoids sudo requirement of using raw sockets by shelling out to ping and thus pinger has an implicit dependency of ping.
Installation
-
Add the dependency to your
shard.yml:dependencies: pinger: github: spider-gazelle/pinger -
Run
shards install
Usage
require "pinger"
hostname = "www.duckduckgo.com"
pinger = Pinger.new(hostname, count: 3)
pinger.ping # => true / false
puts {
host: pinger.ip,
pingable: pinger.pingable,
warning: pinger.warning,
exception: pinger.exception
}
Or if you would like an error raised
require "pinger"
hostname = "www.doesnotexist.com"
pinger = Pinger.new(hostname, count: 3)
pinger.ping! # => self / raise pinger.exception
Todo
- utilise
Crystal::Config.default_targetrather than shelling out to uname
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
Repository
pinger
Owner
Statistic
- 11
- 1
- 1
- 3
- 1
- over 3 years ago
- May 2, 2019
License
MIT License
Links
Synced at
Fri, 24 Oct 2025 19:13:57 GMT
Languages