summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/hostname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/hostname.rb')
-rw-r--r--lib/ohai/plugins/hostname.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/hostname.rb b/lib/ohai/plugins/hostname.rb
index 7940ada2..87a463ef 100644
--- a/lib/ohai/plugins/hostname.rb
+++ b/lib/ohai/plugins/hostname.rb
@@ -42,7 +42,7 @@ Ohai.plugin(:Hostname) do
end
# forward and reverse lookup to canonicalize FQDN (hostname -f equivalent)
- # this is ipv6-safe, works on ruby 1.8.7+
+ # this is ipv6-safe
def resolve_fqdn
require "socket" unless defined?(Socket)
require "ipaddr" unless defined?(IPAddr)
@@ -96,8 +96,8 @@ Ohai.plugin(:Hostname) do
end
collect_data(:darwin) do
- hostname from_cmd("hostname -s")
- machinename from_cmd("hostname")
+ hostname from_cmd("scutil --get HostName")
+ machinename from_cmd("scutil --get ComputerName")
begin
our_fqdn = resolve_fqdn
# Sometimes... very rarely, but sometimes, 'hostname --fqdn' falsely