# encoding: utf-8 module OneApm module Agent module IP 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 end end end