[ 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.mbm5.inc.php 5728 2006-05-03 21:19:46Z allanbush $ 21 // 22 // Note: Make sure you set MBM5 Interval Logging to csv and to the root of PHPSysInfo. 23 // Also make sure MBM5 doesn't at symbols to the values. Did is a Quick MBM5 log parser, 24 // need more csv logs to make it better. 25 // 26 class mbinfo { 27 var $buf_label; 28 var $buf_value; 29 30 function temperature() { 31 $results = array(); 32 33 if (!isset($this->buf_label)) { 34 if ($fp = fopen('MBM5.csv', 'r')) { 35 $this->buf_label = split(';', fgets($fp)); 36 $this->buf_value = split(';', fgets($fp)); 37 fclose($fp); 38 } 39 } 40 41 $results[0]['label'] = $this->buf_label[3]; 42 $results[0]['value'] = $this->buf_value[3]; 43 $results[0]['limit'] = '70.0'; 44 $results[0]['percent'] = $results[0]['value'] * 100 / $results[0]['limit']; 45 $results[1]['label'] = $this->buf_label[4]; 46 $results[1]['value'] = $this->buf_value[4]; 47 $results[1]['limit'] = '70.0'; 48 $results[1]['percent'] = $results[1]['value'] * 100 / $results[1]['limit']; 49 $results[2]['label'] = $this->buf_label[5]; 50 $results[2]['value'] = $this->buf_value[5]; 51 $results[2]['limit'] = '70.0'; 52 $results[2]['percent'] = $results[2]['value'] * 100 / $results[2]['limit']; 53 return $results; 54 } 55 56 function fans() { 57 $results = array(); 58 59 if (!isset($this->buf_label)) { 60 if ($fp = fopen('MBM5.csv', 'r')) { 61 $this->buf_label = split(';', fgets($fp)); 62 $this->buf_value = split(';', fgets($fp)); 63 fclose($fp); 64 } 65 } 66 67 $results[0]['label'] = $this->buf_label[13]; 68 $results[0]['value'] = $this->buf_value[13]; 69 $results[0]['min'] = '3000'; 70 $results[0]['div'] = '2'; 71 $results[1]['label'] = $this->buf_label[14]; 72 $results[1]['value'] = $this->buf_value[14]; 73 $results[1]['min'] = '3000'; 74 $results[1]['div'] = '2'; 75 $results[2]['label'] = $this->buf_label[15]; 76 $results[2]['value'] = $this->buf_value[15]; 77 $results[2]['min'] = '3000'; 78 $results[2]['div'] = '2'; 79 80 return $results; 81 } 82 83 function voltage() { 84 $results = array(); 85 86 if (!isset($this->buf_label)) { 87 if ($fp = fopen('MBM5.csv', 'r')) { 88 $this->buf_label = split(';', fgets($fp)); 89 $this->buf_value = split(';', fgets($fp)); 90 fclose($fp); 91 } 92 } 93 94 $results[0]['label'] = $this->buf_label[6]; 95 $results[0]['value'] = $this->buf_value[6]; 96 $results[0]['min'] = '0.00'; 97 $results[0]['max'] = '0.00'; 98 $results[1]['label'] = $this->buf_label[7]; 99 $results[1]['value'] = $this->buf_value[7]; 100 $results[1]['min'] = '0.00'; 101 $results[1]['max'] = '0.00'; 102 $results[2]['label'] = $this->buf_label[8]; 103 $results[2]['value'] = $this->buf_value[8]; 104 $results[2]['min'] = '0.00'; 105 $results[2]['max'] = '0.00'; 106 $results[3]['label'] = $this->buf_label[9]; 107 $results[3]['value'] = $this->buf_value[9]; 108 $results[3]['min'] = '0.00'; 109 $results[3]['max'] = '0.00'; 110 $results[4]['label'] = $this->buf_label[10]; 111 $results[4]['value'] = $this->buf_value[10]; 112 $results[4]['min'] = '0.00'; 113 $results[4]['max'] = '0.00'; 114 $results[5]['label'] = $this->buf_label[11]; 115 $results[5]['value'] = $this->buf_value[11]; 116 $results[5]['min'] = '0.00'; 117 $results[5]['max'] = '0.00'; 118 $results[6]['label'] = $this->buf_label[12]; 119 $results[6]['value'] = $this->buf_value[12]; 120 $results[6]['min'] = '0.00'; 121 $results[6]['max'] = '0.00'; 122 123 return $results; 124 } 125 } 126 127 ?>
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 |