diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-02 10:37:58 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-02 10:37:58 -0400 |
commit | 9c8e2d62f9d31e371e41affc4d81bc34f96c8eed (patch) | |
tree | 688bbd97ff7c8637d76c31d2018e7f30a4a3a718 /pts-core/modules/system_monitor.php | |
parent | e7e52e2a91379ad4ba44f6c3aaf31272476d4fa4 (diff) | |
download | phoronix-test-suite-upstream-9c8e2d62f9d31e371e41affc4d81bc34f96c8eed.tar.gz phoronix-test-suite-upstream-9c8e2d62f9d31e371e41affc4d81bc34f96c8eed.tar.xz phoronix-test-suite-upstream-9c8e2d62f9d31e371e41affc4d81bc34f96c8eed.zip |
system_monitor: Add support for monitoring hard drive temperature using
hdd.temp through system_hdd_temperature() within pts-core
Diffstat (limited to 'pts-core/modules/system_monitor.php')
-rw-r--r-- | pts-core/modules/system_monitor.php | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php index 944189e..f98bc15 100644 --- a/pts-core/modules/system_monitor.php +++ b/pts-core/modules/system_monitor.php @@ -24,7 +24,7 @@ class system_monitor extends pts_module_interface { const module_name = "System Monitor"; - const module_version = "1.2.0"; + const module_version = "1.2.1"; const module_description = "This module contains sensor monitoring support."; const module_author = "Michael Larabel"; @@ -67,6 +67,11 @@ class system_monitor extends pts_module_interface define("MONITOR_CPU_TEMP", 1); pts_module::save_file(".s/CPU_TEMPERATURE"); } + if(in_array("hdd.temp", $to_show) || $monitor_temp) + { + define("MONITOR_HDD_TEMP", 1); + pts_module::save_file(".s/HDD_TEMPERATURE"); + } if(in_array("sys.temp", $to_show) || $monitor_temp) { define("MONITOR_SYS_TEMP", 1); @@ -183,6 +188,19 @@ class system_monitor extends pts_module_interface array_push($type_index["THERMAL"], count($m_array) - 1); } } + if(defined("MONITOR_HDD_TEMP")) + { + $this_array = self::parse_monitor_log(".s/HDD_TEMPERATURE"); + + if(is_array($this_array) && !empty($this_array[0])) + { + array_push($device, "HDD"); + array_push($type, "Thermal"); + array_push($unit, "°C"); + array_push($m_array, $this_array); + array_push($type_index["THERMAL"], count($m_array) - 1); + } + } if(defined("MONITOR_SYS_TEMP")) { $this_array = self::parse_monitor_log(".s/SYS_TEMPERATURE"); @@ -486,6 +504,13 @@ class system_monitor extends pts_module_interface if($temp != -1) pts_module::save_file(".s/CPU_TEMPERATURE", $temp, true); } + if(defined("MONITOR_HDD_TEMP")) + { + $temp = system_hdd_temperature(); + + if($temp != -1) + pts_module::save_file(".s/HDD_TEMPERATURE", $temp, true); + } if(defined("MONITOR_SYS_TEMP")) { $temp = system_temperature(); @@ -603,7 +628,7 @@ class system_monitor extends pts_module_interface } private function monitor_arguments() { - return array("all", "all.temp", "all.power", "all.voltage", "all.freq", "all.usage", "all.memory", "gpu.temp", "cpu.temp", "sys.temp", "battery.power", "cpu.voltage", "v3.voltage", "v5.voltage", "v12.voltage", "cpu.freq", "gpu.freq", "gpu.usage", "cpu.usage", "system.memory", "swap.memory", "total.memory"); + return array("all", "all.temp", "all.power", "all.voltage", "all.freq", "all.usage", "all.memory", "gpu.temp", "cpu.temp", "hdd.temp", "sys.temp", "battery.power", "cpu.voltage", "v3.voltage", "v5.voltage", "v12.voltage", "cpu.freq", "gpu.freq", "gpu.usage", "cpu.usage", "system.memory", "swap.memory", "total.memory"); } } |