summaryrefslogtreecommitdiffstats
path: root/lib/facter/util/ip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facter/util/ip.rb')
-rw-r--r--lib/facter/util/ip.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index e4370dc..8b6dbf4 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -169,4 +169,11 @@ module Facter::Util::IP
network = ip.mask(subnet.to_s).to_s
end
end
+
+ def self.get_arp_value(interface)
+ arp = Facter::Util::Resolution.exec("arp -en -i #{interface} | sed -e 1d")
+ if arp =~ /^\S+\s+\w+\s+(\S+)\s+\w\s+\S+$/
+ return $1
+ end
+ end
end