From 1281ae4bd341554459036a7e335daf00dae87f61 Mon Sep 17 00:00:00 2001 From: crcro Date: Fri, 12 Aug 2016 00:53:25 +0300 Subject: [PATCH] ipmiSensorName --- html/includes/functions.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index f23a5538d1..19e396a7a8 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -1346,3 +1346,16 @@ function get_ports_from_type($given_types) { $ports = dbFetchRows("SELECT * FROM `ports` as I, `devices` AS D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias", $type_param); return $ports; } + +function ipmiSensorName($hardwareId, $sensorIpmi, $rewriteArray) +{ + if(count($rewriteArray[$hardwareId]) > 0) { + if($rewriteArray[$hardwareId][$sensorIpmi] != "") { + return $rewriteArray[$hardwareId][$sensorIpmi]; + } else { + return $sensorIpmi; + } + } else { + return $sensorIpmi; + } +}