mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Apply "Squiz" code style on old (pre-2014) files
This commit is contained in:
@@ -3,12 +3,9 @@
|
||||
$dmi = $agent_data['dmi'];
|
||||
unset($agent_data['dmi']);
|
||||
|
||||
foreach (explode("\n",$dmi) as $line)
|
||||
{
|
||||
list($field,$contents) = explode("=",$line,2);
|
||||
$agent_data['dmi'][$field] = trim($contents);
|
||||
foreach (explode("\n", $dmi) as $line) {
|
||||
list($field,$contents) = explode('=', $line, 2);
|
||||
$agent_data['dmi'][$field] = trim($contents);
|
||||
}
|
||||
|
||||
unset($dmi);
|
||||
|
||||
?>
|
||||
@@ -2,25 +2,26 @@
|
||||
|
||||
global $agent_sensors;
|
||||
|
||||
include_once("includes/discovery/functions.inc.php");
|
||||
require_once 'includes/discovery/functions.inc.php';
|
||||
|
||||
if ($agent_data['haddtemp'] != '|')
|
||||
{
|
||||
$disks = explode('||',trim($agent_data['hddtemp'],'|'));
|
||||
if ($agent_data['haddtemp'] != '|') {
|
||||
$disks = explode('||', trim($agent_data['hddtemp'], '|'));
|
||||
|
||||
if (count($disks))
|
||||
{
|
||||
echo "hddtemp: ";
|
||||
foreach ($disks as $disk)
|
||||
{
|
||||
list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4);
|
||||
$diskcount++;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent');
|
||||
if (count($disks)) {
|
||||
echo 'hddtemp: ';
|
||||
foreach ($disks as $disk)
|
||||
{
|
||||
list($blockdevice,$descr,$temperature,$unit) = explode('|', $disk, 4);
|
||||
$diskcount++;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', null, null, null, null, $temperature, 'agent');
|
||||
|
||||
$agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount);
|
||||
$agent_sensors['temperature']['hddtemp'][$diskcount] = array(
|
||||
'description' => "$blockdevice: $descr",
|
||||
'current' => $temperature,
|
||||
'index' => $diskcount,
|
||||
);
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}//end if
|
||||
|
||||
Reference in New Issue
Block a user