[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 3 // phpSysInfo - A PHP System Information Script 4 // http://phpsysinfo.sourceforge.net/ 5 6 // This program is free software; you can redistribute it and/or 7 // modify it under the terms of the GNU General Public License 8 // as published by the Free Software Foundation; either version 2 9 // of the License, or (at your option) any later version. 10 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software 18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20 // $Id: class.healthd.inc.php,v 1.5 2004/10/30 08:09:27 webbie Exp $ 21 22 class mbinfo { 23 var $lines; 24 25 function temperature() { 26 $ar_buf = array(); 27 $results = array(); 28 29 if (!isset($this->lines)) { 30 $this->lines = execute_program('healthdc', '-t'); 31 } 32 33 $ar_buf = preg_split("/\t+/", $this->lines); 34 35 $results[0]['label'] = 'temp1'; 36 $results[0]['value'] = $ar_buf[1]; 37 $results[0]['limit'] = '70.0'; 38 $results[0]['percent'] = $results[0]['value'] * 100 / $results[0]['limit']; 39 $results[1]['label'] = 'temp2'; 40 $results[1]['value'] = $ar_buf[2]; 41 $results[1]['limit'] = '70.0'; 42 $results[1]['percent'] = $results[1]['value'] * 100 / $results[1]['limit']; 43 $results[2]['label'] = 'temp3'; 44 $results[2]['value'] = $ar_buf[3]; 45 $results[2]['limit'] = '70.0'; 46 $results[2]['percent'] = $results[2]['value'] * 100 / $results[2]['limit']; 47 return $results; 48 } 49 50 function fans() { 51 $ar_buf = array(); 52 $results = array(); 53 54 if (!isset($this->lines)) { 55 $this->lines = execute_program('healthdc', '-t'); 56 } 57 58 $ar_buf = preg_split("/\t+/", $this->lines); 59 60 $results[0]['label'] = 'fan1'; 61 $results[0]['value'] = $ar_buf[4]; 62 $results[0]['min'] = '3000'; 63 $results[0]['div'] = '2'; 64 $results[1]['label'] = 'fan2'; 65 $results[1]['value'] = $ar_buf[5]; 66 $results[1]['min'] = '3000'; 67 $results[1]['div'] = '2'; 68 $results[2]['label'] = 'fan3'; 69 $results[2]['value'] = $ar_buf[6]; 70 $results[2]['min'] = '3000'; 71 $results[2]['div'] = '2'; 72 73 return $results; 74 } 75 76 function voltage() { 77 $ar_buf = array(); 78 $results = array(); 79 80 if (!isset($this->lines)) { 81 $this->lines = execute_program('healthdc', '-t'); 82 } 83 84 $ar_buf = preg_split("/\t+/", $this->lines); 85 86 $results[0]['label'] = 'Vcore1'; 87 $results[0]['value'] = $ar_buf[7]; 88 $results[0]['min'] = '0.00'; 89 $results[0]['max'] = '0.00'; 90 $results[1]['label'] = 'Vcore2'; 91 $results[1]['value'] = $ar_buf[8]; 92 $results[1]['min'] = '0.00'; 93 $results[1]['max'] = '0.00'; 94 $results[2]['label'] = '3volt'; 95 $results[2]['value'] = $ar_buf[9]; 96 $results[2]['min'] = '0.00'; 97 $results[2]['max'] = '0.00'; 98 $results[3]['label'] = '+5Volt'; 99 $results[3]['value'] = $ar_buf[10]; 100 $results[3]['min'] = '0.00'; 101 $results[3]['max'] = '0.00'; 102 $results[4]['label'] = '+12Volt'; 103 $results[4]['value'] = $ar_buf[11]; 104 $results[4]['min'] = '0.00'; 105 $results[4]['max'] = '0.00'; 106 $results[5]['label'] = '-12Volt'; 107 $results[5]['value'] = $ar_buf[12]; 108 $results[5]['min'] = '0.00'; 109 $results[5]['max'] = '0.00'; 110 $results[6]['label'] = '-5Volt'; 111 $results[6]['value'] = $ar_buf[13]; 112 $results[6]['min'] = '0.00'; 113 $results[6]['max'] = '0.00'; 114 115 return $results; 116 } 117 } 118 119 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |