+default[:hardware][:sensors] = {}
+
if node[:dmi] and node[:dmi][:system]
case dmi.system.manufacturer
when "HP"
default[:apt][:sources] |= [ "management-component-pack" ]
+
+ case dmi.system.product_name
+ when "ProLiant DL360 G6", "ProLiant DL360 G7"
+ default[:hardware][:sensors][:power][:power1] = { :ignore => true }
+ end
end
end
--- /dev/null
+class Chef
+ class Sensors
+ def self.attributes(sensors, attribute_names)
+ sensors ||= {}
+ results = []
+
+ sensors.sort.each do |sensor,attributes|
+ if attributes[:ignore]
+ results << "ignore #{sensor}"
+ else
+ if label = attributes[:label]
+ resuls << "label #{sensor} \"#{label}\""
+ end
+
+ if compute = attributes[:compute]
+ resuls << "compute #{sensor} #{compute}"
+ end
+
+ attribute_names.each do |name|
+ if value = attributes[name]
+ results << "set #{sensor}_#{name} #{value}"
+ end
+ end
+ end
+ end
+
+ results.map { |r| " #{r}\n" }.join("")
+ end
+ end
+end
action [ :enable, :start ]
end
end
+
+unless Dir.glob("/sys/class/hwmon/hwmon*").empty?
+ package "lm-sensors"
+
+ execute "/etc/sensors.d/chef.conf" do
+ action :nothing
+ command "/usr/bin/sensors -s"
+ user "root"
+ group "root"
+ end
+
+ template "/etc/sensors.d/chef.conf" do
+ source "sensors.conf.erb"
+ owner "root"
+ group "root"
+ mode 0644
+ notifies :run, "execute[/etc/sensors.d/chef.conf]"
+ end
+end
--- /dev/null
+# DO NOT EDIT - This file is being maintained by Chef
+<% node[:hardware][:sensors].sort.each do |chip,sensors| -%>
+
+chip "<%= chip %>"
+<%= Chef::Sensors.attributes sensors[:volts], [:min, :max] -%>
+<%= Chef::Sensors.attributes sensors[:fans], [:min] -%>
+<%= Chef::Sensors.attributes sensors[:temps], [:max, :max_hyst, :crit, :crit_hyst] -%>
+<%= Chef::Sensors.attributes sensors[:power], [:interval] -%>
+<% end -%>
notifies :restart, "service[munin-node]"
end
-if node[:dmi] and node[:dmi][:system] and node[:dmi][:system][:manufacturer] == "HP"
- case node[:dmi][:system][:product_name]
- when "ProLiant DL360 G6", "ProLiant DL360 G7"
- template "/etc/sensors.d/disable-bad-acpi-sensor.conf" do
- source "disable-bad-acpi-sensor.conf.erb"
- owner "root"
- group "root"
- mode 0644
- end
- end
-end
-
if Dir.glob("/proc/acpi/thermal_zone/*/temperature").empty?
munin_plugin "acpi" do
action :delete
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-chip "power_meter-*"
- ignore power1
description "Master role applied to errol"
default_attributes(
- :munin => {
- :plugins => {
- :ipmi_fans => {
- :Sys3Front1 => { :graph => "no" },
- :Sys4Front2 => { :graph => "no" },
- :Sys5Rear1 => { :graph => "no" },
- :Sys6 => { :graph => "no" },
- :Sys7 => { :graph => "no" },
- :Sys8 => { :graph => "no" },
- :Sys9 => { :graph => "no" },
- :Sys10 => { :graph => "no" }
- },
- :ipmi_temp => {
- :CPU0belowTmax => { :critical => "10:" },
- :CPU1belowTmax => { :critical => "10:" }
- },
- :sensors_fan => {
- :contacts => "null"
- },
- :sensors_temp => {
- :contacts => "null"
- },
- :sensors_volt => {
- :contacts => "null",
- :volt10 => {
- :warning => "3.11:3.50",
- :critical => "2.98:3.63"
- }
- }
- }
- },
:devices => {
:osdsk => {
:comment => "First os disk",
run_list(
"role[ucl-wolfson]",
+ "role[tyan-s7010]",
"role[dev]"
)
}
}
},
- :munin => {
- :plugins => {
- :ipmi_fans => {
- :Sys3Front1 => { :graph => "no" },
- :Sys4Front2 => { :graph => "no" },
- :Sys5Rear1 => { :graph => "no" },
- :Sys6 => { :graph => "no" },
- :Sys7 => { :graph => "no" },
- :Sys8 => { :graph => "no" },
- :Sys9 => { :graph => "no" },
- :Sys10 => { :graph => "no" }
- },
- :ipmi_temp => {
- :CPU0belowTmax => { :critical => "10:" },
- :CPU1belowTmax => { :critical => "10:" }
- },
- :sensors_fan => {
- :fan3 => { :graph => "no" },
- :fan4 => { :graph => "no" },
- :fan5 => { :graph => "no" },
- :fan6 => { :graph => "no" },
- :fan7 => { :graph => "no" },
- :fan8 => { :graph => "no" },
- :fan9 => { :graph => "no" },
- :fan10 => { :graph => "no" },
- :fan11 => { :graph => "no" },
- :fan12 => { :graph => "no" }
- },
- :sensors_volt => {
- :contacts => "null",
- :volt6 => {
- :warning => "2.992:3.536"
- }
- }
- }
- },
:networking => {
:interfaces => {
:external_ipv4 => {
run_list(
"role[ic]",
+ "role[tyan-s7010]",
"role[tile]"
)
:max_children => "10"
}
}
- },
- :munin => {
- :plugins => {
- :ipmi_fans => {
- :Sys3Front1 => { :graph => "no" },
- :Sys4Front2 => { :graph => "no" },
- :Sys5Rear1 => { :graph => "no" },
- :Sys6 => { :graph => "no" },
- :Sys7 => { :graph => "no" },
- :Sys8 => { :graph => "no" },
- :Sys9 => { :graph => "no" },
- :Sys10 => { :graph => "no" }
- },
- :ipmi_temp => {
- :CPU0belowTmax => { :critical => "10:" },
- :CPU1belowTmax => { :critical => "10:" }
- },
- :sensors_volt => {
- :volt6 => {
- :warning => "2.992:3.536"
- },
- :volt10 => {
- :warning => "2.71:3.29"
- }
- }
- }
}
)
run_list(
"role[ucl-wolfson]",
+ "role[tyan-s7010]",
"role[nominatim]"
)
--- /dev/null
+name "tyan-s7010"
+description "Role applied to machines using the Tyan S710 motherboard"
+
+default_attributes(
+ :hardware => {
+ :sensors => {
+ "jc42-*" => {
+ :temps => {
+ "temp1" => { :max => 75 }
+ }
+ },
+ "w83793-i2c-*-2f" => {
+ :volts => {
+ "in0" => { :min => 0.696, :max => 1.424 },
+ "in1" => { :min => 0.696, :max => 1.424 },
+ "in5" => { :min => 2.992, :max => 3.536 },
+ "in9" => { :min => 2.608, :max => 3.536 }
+ },
+ :fans => {
+ "fan3" => { :ignore => true },
+ "fan4" => { :ignore => true },
+ "fan5" => { :ignore => true },
+ "fan6" => { :ignore => true },
+ "fan7" => { :ignore => true },
+ "fan8" => { :ignore => true },
+ "fan9" => { :ignore => true },
+ "fan10" => { :ignore => true },
+ "fan11" => { :ignore => true },
+ "fan12" => { :ignore => true }
+ },
+ :temps => {
+ "temp5" => { :max => 78, :max_hyst => 73 },
+ "temp6" => { :max => 78, :max_hyst => 73 }
+ }
+ }
+ },
+ },
+ :munin => {
+ :plugins => {
+ :ipmi_fans => {
+ :Sys3Front1 => { :graph => "no" },
+ :Sys4Front2 => { :graph => "no" },
+ :Sys5Rear1 => { :graph => "no" },
+ :Sys6 => { :graph => "no" },
+ :Sys7 => { :graph => "no" },
+ :Sys8 => { :graph => "no" },
+ :Sys9 => { :graph => "no" },
+ :Sys10 => { :graph => "no" }
+ },
+ :ipmi_temp => {
+ :CPU0belowTmax => { :critical => "10:" },
+ :CPU1belowTmax => { :critical => "10:" }
+ }
+ }
+ }
+)
:warning => 150,
:critical => 200
}
- },
- :ipmi_fans => {
- :Sys3Front1 => { :graph => "no" },
- :Sys4Front2 => { :graph => "no" },
- :Sys5Rear1 => { :graph => "no" },
- :Sys6 => { :graph => "no" },
- :Sys7 => { :graph => "no" },
- :Sys8 => { :graph => "no" },
- :Sys9 => { :graph => "no" },
- :Sys10 => { :graph => "no" }
- },
- :ipmi_temp => {
- :CPU0belowTmax => { :critical => "10:" },
- :CPU1belowTmax => { :critical => "10:" }
- },
- :sensors_fan => {
- :contacts => "null"
- },
- :sensors_temp => {
- :contacts => "null"
- },
- :sensors_volt => {
- :contacts => "null"
}
}
},
run_list(
"role[ucl-wolfson]",
+ "role[tyan-s7010]",
"role[tile]"
)