pingfacts 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pingfacts.rb +8 -5
- data/lib/pingfacts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e292ddadb1df2eacdb19ad584f375451a97cb5ad215198c91002c28a1e131c48
|
4
|
+
data.tar.gz: 1e42044bfa77c46f96c55e3b3e45f6b88a6baa39167e1be9fb2f5d58e1f6f41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4655c52d704d5a19a9daf70ea8a240a638b11c2eea54d71aaf396741ff664b41e7002edee0cfb0c9d23e9f581a5e4b5248a2ad88ba54a345a8c692db5af8f99
|
7
|
+
data.tar.gz: 80ddf560aaa5887b2bc0983a02bfdc6fb03f87a587b015f322b334700c3d3f0af048c23d29f9e88e22a348e976f8cfe53b9e1301aed60c46e25ab22288fb0b50
|
data/lib/pingfacts.rb
CHANGED
@@ -30,11 +30,14 @@ module Pingfacts
|
|
30
30
|
end
|
31
31
|
|
32
32
|
mac_addresses = {}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
begin
|
34
|
+
`ip neigh`.lines.each do |line|
|
35
|
+
r = line.split(/\s+/)
|
36
|
+
if r[3] == "lladdr"
|
37
|
+
mac_addresses[r[0].strip] = r[4].strip
|
38
|
+
end
|
37
39
|
end
|
40
|
+
rescue
|
38
41
|
end
|
39
42
|
|
40
43
|
result = []
|
@@ -47,7 +50,7 @@ module Pingfacts
|
|
47
50
|
end
|
48
51
|
begin
|
49
52
|
ipresult.dnsname = Resolv.getname(ip)
|
50
|
-
rescue
|
53
|
+
rescue
|
51
54
|
end
|
52
55
|
|
53
56
|
result << ipresult
|
data/lib/pingfacts/version.rb
CHANGED