diff --git a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_helpers.php b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_helpers.php index d352f8af..3bb1432b 100644 --- a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_helpers.php +++ b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_helpers.php @@ -19,9 +19,9 @@ $ipaddr = preg_match('/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[ $cfg['IPADDR'] : trim(shell_exec("/usr/bin/ipmitool lan print | grep 'IP Address ' | sed -n -e 's/^.*: //p'")); -$cpu = isset($cfg['CPU_TEMP']) ? $cfg['CPU_TEMP'] : ""; // cpu temp display name -$mb = isset($cfg['MB_TEMP']) ? $cfg['MB_TEMP'] : ""; // mb temp display name -$fan = isset($cfg['IPMI_FAN']) ? $cfg['IPMI_FAN'] : ""; // fan speed display name +$cpu_temp = isset($cfg['CPU_TEMP']) ? $cfg['CPU_TEMP'] : ""; // cpu temp display name +$mb_temp = isset($cfg['MB_TEMP']) ? $cfg['MB_TEMP'] : ""; // mb temp display name +$fan_disp = isset($cfg['FAN_DISP']) ? $cfg['FAN_DISP'] : ""; // fan speed display name $user = isset($cfg['USER']) ? $cfg['USER'] : ""; // user for remote access $password = isset($cfg['PASSWORD']) ? $cfg['PASSWORD'] : ""; // password for remote access diff --git a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_temp.php b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_temp.php index bbfbaaf6..58da0706 100644 --- a/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_temp.php +++ b/source/ipmitool-plugin/usr/local/emhttp/plugins/ipmitool-plugin/include/ipmitool_temp.php @@ -5,18 +5,18 @@ function ipmi_temp($reading, $unit, $dot) { return ($reading>0 ? ($unit=='F' ? round(9/5*$reading+32) : str_replace('.',$dot,$reading)) : '##')." $unit"; } -if ($cpu || $mb || $fan){ - $readings = ipmi_get_reading([$cpu, $mb, $fan], $options); +if ($cpu_temp || $mb_temp || $fan_disp){ + $readings = ipmi_get_reading([$cpu_temp, $mb_temp, $fan_disp], $options); $temps = []; - if ($readings[$cpu]) - $temps[] = "".ipmi_temp($readings[$cpu], $_GET['unit'], $_GET['dot']); + if ($readings[$cpu_temp]) + $temps[] = "".ipmi_temp($readings[$cpu_temp], $_GET['unit'], $_GET['dot']); - if ($readings[$mb]) - $temps[] = "".ipmi_temp($readings[$mb], $_GET['unit'], $_GET['dot']); + if ($readings[$mb_temp]) + $temps[] = "".ipmi_temp($readings[$mb_temp], $_GET['unit'], $_GET['dot']); - if ($readings[$fan]) - $temps[] = "".$readings[$fan]." rpm"; + if ($readings[$fan_disp]) + $temps[] = "".$readings[$fan_disp]." rpm"; } if ($temps) echo "".implode(' ', $temps)."";