Module: OneApm::Agent::IP
- Defined in:
- lib/one_apm/support/ip.rb
Class Method Summary collapse
Class Method Details
.get ⇒ Object
6 7 8 9 10 11 |
# File 'lib/one_apm/support/ip.rb', line 6 def self.get ipinfo = `/sbin/ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}'`.split("\n")[0].sub(/addr:|地址:|\s+/, '') ipinfo.split("\n")[0].sub(/addr:|地址:|\s+/, '') rescue => e nil end |