LoginSignup
22
23

More than 5 years have passed since last update.

pingが通ったらベルを鳴らす

Last updated at Posted at 2014-05-06

ネットワークのテストだったり、リモートサーバを再起動させたときに、pingの結果を目で確認するのではなく、BEEPで確認できると楽だったりします。

確認はLinux(Ubuntu)で行いました。Unix全般でできるはずです。

やり方

$ ping 192.168.100.100 | tr : ^G

^Gの入力方法は Ctrl-V のあとに Ctrl-G を押します。

説明

pingが通ったとき

$ ping 192.168.100.100
PING 192.168.100.100 (192.168.100.100) 56(84) bytes of data.
64 bytes from 192.168.100.100: icmp_req=1 ttl=64 time=3.74 ms
64 bytes from 192.168.100.100: icmp_req=2 ttl=64 time=1.40 ms

pingが通らなかったとき

$ ping 192.168.100.100
PING 192.168.100.100 (192.168.100.100) 56(84) bytes of data.
From 192.168.100.101 icmp_seq=1 Destination Host Unreachable
From 192.168.100.101 icmp_seq=2 Destination Host Unreachable

なので、:^Gに置換すればベルが鳴ります。

22
23
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
23