https://github.com/bestwebua/packet-loss-logger
ICMP Packet Loss Logger.
https://github.com/bestwebua/packet-loss-logger
Last synced: about 2 months ago
JSON representation
ICMP Packet Loss Logger.
- Host: GitHub
- URL: https://github.com/bestwebua/packet-loss-logger
- Owner: bestwebua
- License: other
- Created: 2017-11-16T09:33:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-10T12:13:40.000Z (almost 7 years ago)
- Last Synced: 2025-02-14T09:44:16.668Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ICMP Packet Loss Logger
## Description
Simple terminal ICMP packet loss logger by Vladislav Trotsenko (https://github.com/bestwebua).
Build with using net/ping gem (https://github.com/djberg96/net-ping).### Requirements
```
>= Ruby 1.9.3
>= gem net-ping 2.0.2
```#### Installation
Please note, this script should run with superadmin permissions (this is features of net/ping gem work. CentOS example without preinstalled Ruby:
- - -
##### Installing environment
```bash
yum groupinstall -y development
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm reload
rvm install 2.1.0
ruby --version #checkout your current default ruby interpreter
gem install net-ping
```
###### Installing script
Without git:
```bash
mkdir /etc/packet-loss-logger && cd $_
culr -O https://raw.githubusercontent.com/bestwebua/packet-loss-logger/master/pll.rb
culr -O https://raw.githubusercontent.com/bestwebua/packet-loss-logger/master/packet_loss_logger.rb
```
Using git:
```bash
cd /etc
git clone https://github.com/bestwebua/packet-loss-logger
```
- - -
##### Running ICMP Packet Loss Logger
For execution in background I have used screen. To create a screen and start working with it run this command, where 'pll' - the name of a screen. It may be any name, like screen1, test1, etc.
```bash
$ screen -S pll
```
To start the script, run pll.rb with next pattern: `[host_name] [packet_size_in_bytes] [runtime format: 1s, 1m , 1h or 1d]`
```bash
$ ruby /etc/packet-loss-logger/pll.rb google.com 1000 1m
```
- - -
##### How to use the screen?
To exit screen, use the ` + & ` keys. All processes running in your screen are still being executed. To return to your screen or to any other screen, use:
```bash
$ screen -r
```
or list your screens:
```bash
$ screen -ls
```
and select and activate one of the screen that you need:
```bash
$ screen -r
```
When you no longer need a screen session, you can kill it. To do this, login into your screen and press ` + `.
- - -
##### Reading the ICMP Packet Loss Log
```bash
$ cat /etc/packet-loss-logger/log.txt
```
- - -