Method: Sensu::Utilities#system_hostname

Defined in:
lib/sensu/utilities.rb

#system_hostnameString

Retrieve the system hostname. If the hostname cannot be determined and an error is thrown, ‘nil` will be returned.

Returns:

  • (String)

    system hostname.



84
85
86
# File 'lib/sensu/utilities.rb', line 84

def system_hostname
  ::Socket.gethostname rescue nil
end