* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme

- Adding SM2 panel [SME: 13004]
- Upgrade to phpsysinfo 3.4.4
- Add code to delete inline styles and add css to make it look better.
- version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
2025-05-14 16:14:01 +01:00
parent 80b1da5fa5
commit c8ce77259d
952 changed files with 51341 additions and 28699 deletions

View File

@@ -1,25 +1,14 @@
<?php
/**
* freeipmi sensor class
* freeipmi sensor class, getting information from ipmi-sensors
*
* PHP version 5
*
* @category PHP
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @version SVN: $Id: class.freeipmi.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
/**
* getting information from ipmi-sensors
*
* @category PHP
* @package PSI_Sensor
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @author Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
* @copyright 2014 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
* @version Release: 3.0
* @link http://phpsysinfo.sourceforge.net
*/
@@ -33,24 +22,23 @@ class FreeIPMI extends Sensors
private $_lines = array();
/**
* fill the private content var through tcp or file access
* fill the private content var through command or data access
*/
public function __construct()
{
parent::__construct();
switch (strtolower(PSI_SENSOR_ACCESS)) {
if ((PSI_OS != 'WINNT') && (!defined('PSI_EMU_HOSTNAME') || defined('PSI_EMU_PORT'))) switch (defined('PSI_SENSOR_FREEIPMI_ACCESS')?strtolower(PSI_SENSOR_FREEIPMI_ACCESS):'command') {
case 'command':
CommonFunctions::executeProgram('ipmi-sensors', '--output-sensor-thresholds', $lines);
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
break;
case 'file':
if (CommonFunctions::rfts(APP_ROOT.'/data/freeipmi.txt', $lines)) {
$this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
case 'data':
if (!defined('PSI_EMU_PORT') && CommonFunctions::rftsdata('freeipmi.tmp', $lines)) {
$this->_lines = preg_split("/\r?\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
}
break;
default:
$this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
break;
$this->error->addConfigError('__construct()', '[sensor_freeipmi] ACCESS');
}
}
@@ -152,6 +140,7 @@ class FreeIPMI extends Sensors
$dev = new SensorDevice();
$dev->setName($buffer[1]);
$dev->setValue($buffer[3]);
if ($buffer[6] != "N/A") $dev->setMin($buffer[6]);
if ($buffer[9] != "N/A") $dev->setMax($buffer[9]);
if ($buffer[11] != "'OK'") $dev->setEvent(trim($buffer[11], "'"));
$this->mbinfo->setMbCurrent($dev);
@@ -159,12 +148,31 @@ class FreeIPMI extends Sensors
}
}
/**
* get other information
*
* @return void
*/
private function _other()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[4] == "N/A"
&& $buffer[2] != "OEM Reserved" && $buffer[11] != "N/A") {
$dev = new SensorDevice();
$dev->setName($buffer[1].' ('.$buffer[2].')');
$dev->setValue(trim($buffer[11], '\''));
$this->mbinfo->setMbOther($dev);
}
}
}
/**
* get the information
*
* @see PSI_Interface_Sensor::build()
*
* @return Void
* @return void
*/
public function build()
{
@@ -173,5 +181,6 @@ class FreeIPMI extends Sensors
$this->_fans();
$this->_power();
$this->_current();
$this->_other();
}
}