Method: Sensu::Utilities#system_hostname
- Defined in:
- lib/sensu/utilities.rb
#system_hostname ⇒ String
Retrieve the system hostname. If the hostname cannot be determined and an error is thrown, ‘nil` will be returned.
84 85 86 |
# File 'lib/sensu/utilities.rb', line 84 def system_hostname ::Socket.gethostname rescue nil end |