Method: Sensu::Utilities#system_address
- Defined in:
- lib/sensu/utilities.rb
#system_address ⇒ String
Retrieve the system IP address. If a valid non-loopback IPv4 address cannot be found and an error is thrown, ‘nil` will be returned.
93 94 95 96 97 |
# File 'lib/sensu/utilities.rb', line 93 def system_address ::Socket.ip_address_list.find { |address| address.ipv4? && !address.ipv4_loopback? }.ip_address rescue nil end |