mtr_monitor 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/mtr_monitor/version.rb +1 -1
- data/lib/mtr_monitor.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c1ae91ed9bd4cc5cdace5a8e2e348a80138401e
|
4
|
+
data.tar.gz: ca8a306ea9aa87dd6ffd919cded83c4ef83d11cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e071b79a6e14c86bafbf82d63d2fceb2e048cc8b5be46551cde6bdc9f0200e296b2d7784baabc757dd279a630413d34efe3ce51ff2332acb446f23b96dc0242
|
7
|
+
data.tar.gz: 9f84f8bec6b0443e68631ec13689d4a5b5f5a35b5fc02cb2a18c1e80d148d8a22e80522208a4711403843638bdf3733b977c4d763fddbe057ddd78e404f97022
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -64,25 +64,25 @@ Local reports on the machine are located in the `/var/log/mtr` directory, and
|
|
64
64
|
the following structure:
|
65
65
|
|
66
66
|
``` txt
|
67
|
-
/var/log/mtr/<name>-<YYYY-DD-MM>-<host-ip-address>-<HH-MM>.log
|
67
|
+
/var/log/mtr/<name>-<YYYY-DD-MM>-<host-ip-address>-<target-ip-address>-<HH-MM>.log
|
68
68
|
```
|
69
69
|
|
70
70
|
For example, if you call your report `hetzner-to-us-east-1` and run it at
|
71
71
|
`2017-12-18 12:33:06`, the log will be generated in:
|
72
72
|
|
73
73
|
``` txt
|
74
|
-
/var/log/mtr/hetzner-to-us-east-1-2017-12-18-142-21-43-11-12-33.log
|
74
|
+
/var/log/mtr/hetzner-to-us-east-1-2017-12-18-142-21-43-11-138-21-32-191-12-33.log
|
75
75
|
```
|
76
76
|
|
77
77
|
On S3, the path will follow the same convention, but will use a nested directory
|
78
78
|
structure:
|
79
79
|
|
80
80
|
``` txt
|
81
|
-
s3://<bucket-name>/<name>/<YYYY-DD-MM>/<host-ip-address>/<HH-MM>.log
|
81
|
+
s3://<bucket-name>/<name>/<YYYY-DD-MM>/<host-ip-address>/<target-ip-address>/<HH-MM>.log
|
82
82
|
```
|
83
83
|
|
84
84
|
``` txt
|
85
|
-
s3://<bucket-name>/hetzner-to-us-east-1/2017-12-18/142-21-43-11/12-33.log
|
85
|
+
s3://<bucket-name>/hetzner-to-us-east-1/2017-12-18/142-21-43-11/138-21-32-191/12-33.log
|
86
86
|
```
|
87
87
|
|
88
88
|
## Report Name
|
data/lib/mtr_monitor/version.rb
CHANGED
data/lib/mtr_monitor.rb
CHANGED
@@ -15,7 +15,7 @@ module MtrMonitor
|
|
15
15
|
# /var/log/mtr/<name>-<YYYY-DD-MM>-<host-ip-address>-<HH-MM>.log
|
16
16
|
#
|
17
17
|
# After that, it uploads the report to S3:
|
18
|
-
# s3://<bucket-name>/<name>/<YYYY-DD-MM>/<host-ip-address>/<HH-MM>.log
|
18
|
+
# s3://<bucket-name>/<name>/<YYYY-DD-MM>/<host-ip-address>/<target-ip-address>/<HH-MM>.log
|
19
19
|
#
|
20
20
|
# Parameters:
|
21
21
|
#
|
@@ -76,12 +76,12 @@ module MtrMonitor
|
|
76
76
|
|
77
77
|
def generate_local_report
|
78
78
|
run %Q(sudo mkdir -p /var/log/mtr)
|
79
|
-
run %Q(sudo sh -c 'echo "Version: #{MtrMonitor::VERSION}"
|
80
|
-
run %Q(sudo sh -c 'echo "Name: #{@name}"
|
81
|
-
run %Q(sudo sh -c 'echo "Domain: #{@domain}"
|
82
|
-
run %Q(sudo sh -c 'echo "Source IP: #{@host_ip_address}"
|
83
|
-
run %Q(sudo sh -c 'echo "Target IP: #{destination}"
|
84
|
-
run %Q(sudo sh -c 'echo "
|
79
|
+
run %Q(sudo sh -c 'echo "Version: #{MtrMonitor::VERSION.ljust(30)}" >> #{local_log_path}')
|
80
|
+
run %Q(sudo sh -c 'echo "Name: #{@name.ljust(30)}" >> #{local_log_path}')
|
81
|
+
run %Q(sudo sh -c 'echo "Domain: #{@domain.ljust(30)}" >> #{local_log_path}')
|
82
|
+
run %Q(sudo sh -c 'echo "Source IP: #{@host_ip_address.ljust(30)}" >> #{local_log_path}')
|
83
|
+
run %Q(sudo sh -c 'echo "Target IP: #{destination.ljust(30)}" >> #{local_log_path}')
|
84
|
+
run %Q(sudo sh -c 'echo "-----------------------------------------" >> #{local_log_path}')
|
85
85
|
run %Q(sudo sh -c 'mtr --report --report-wide #{@mtr_options} #{destination} >> #{local_log_path}')
|
86
86
|
end
|
87
87
|
|