Skip to content

Instantly share code, notes, and snippets.

@dougm
Created April 20, 2011 17:45
Show Gist options
  • Save dougm/932110 to your computer and use it in GitHub Desktop.
Save dougm/932110 to your computer and use it in GitHub Desktop.
elsif name == "winnt"
product_type = node[:kernel][:os_info][:product_type].to_i
version_major, version_minor, version_build =
node[:kernel][:os_info][:version].split(".").map { |v| v.to_i }
if version_major == 4
distro = "nt"
elsif version_major == 5
distro = case version_minor
when 0 then "2000"
when 1 then "xp"
when 2 then "2003"
else "unknown"
end
elsif version_major == 6
if product_type == 1 #VER_NT_WORKSTATION
if version_minor == 0
distro = "vista"
else
distro = "7"
end
else
distro = "2008"
end
end
default[:sigar][:platform][:distro] = distro
description = kernel.os_info.caption.strip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment