if(mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$oid_chassis' AND temp_host = '$id'"),0)=='0')
{
$query="INSERT INTO temperature (`temp_host`, `temp_oid`, `temp_descr`, `temp_precision`, `temp_limit`, `temp_current`) values ('$id', '$oid_chassis', '$descr_chassis',1,".($config['defaults']['temp_limit']?$config['defaults']['temp_limit']:'60').", '$temp_chassis')";
mysql_query($query);
echo("+");
}elseif(mysql_result(mysql_query("SELECT `temp_descr` FROM temperature WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_chassis'"),0)!=$descr_chassis){
echo("U");
mysql_query("UPDATE temperature SET `temp_descr` = '$descr_chassis' WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_chassis'");
}else{
echo(".");
}
$temp_exists[]="$id$oid_chassis";
}
echo("STM16 ");
if($temp_stm16!="0")
{
if(mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$oid_stm16' AND temp_host = '$id'"),0)=='0')
{
$query="INSERT INTO temperature (`temp_host`, `temp_oid`, `temp_descr`, `temp_precision`, `temp_limit`, `temp_current`) values ('$id', '$oid_stm16', '$descr_stm16',1,".($config['defaults']['temp_limit']?$config['defaults']['temp_limit']:'60').", '$temp_stm16')";
mysql_query($query);
echo("+");
}elseif(mysql_result(mysql_query("SELECT `temp_descr` FROM temperature WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_stm16'"),0)!=$descr_stm16){
echo("U");
mysql_query("UPDATE temperature SET `temp_descr` = '$descr_stm16' WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_stm16'");
}else{
echo(".");
}
$temp_exists[]="$id$oid_stm16";
}
echo("HSS1 ");
if($temp_hss1!="0")
{
if(mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$oid_hss1' AND temp_host = '$id'"),0)=='0')
{
$query="INSERT INTO temperature (`temp_host`, `temp_oid`, `temp_descr`, `temp_precision`, `temp_limit`, `temp_current`) values ('$id', '$oid_hss1', '$descr_hss1',1,".($config['defaults']['temp_limit']?$config['defaults']['temp_limit']:'60').", '$temp_hss1')";
mysql_query($query);
echo("+");
}elseif(mysql_result(mysql_query("SELECT `temp_descr` FROM temperature WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_hss1'"),0)!=$descr_hss1){
echo("U");
mysql_query("UPDATE temperature SET `temp_descr` = '$descr_hss1' WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_hss1'");
}else{
echo(".");
}
$temp_exists[]="$id$oid_hss1";
}
echo("HSS2 ");
if($temp_hss2!="0")
{
if(mysql_result(mysql_query("SELECT count(temp_id) FROM `temperature` WHERE temp_oid = '$oid_hss2' AND temp_host = '$id'"),0)=='0')
{
$query="INSERT INTO temperature (`temp_host`, `temp_oid`, `temp_descr`, `temp_precision`, `temp_limit`, `temp_current`) values ('$id', '$oid_hss2', '$descr_hss2',1,".($config['defaults']['temp_limit']?$config['defaults']['temp_limit']:'60').", '$temp_hss2')";
mysql_query($query);
echo("+");
}elseif(mysql_result(mysql_query("SELECT `temp_descr` FROM temperature WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_hss2'"),0)!=$descr_hss2){
echo("U");
mysql_query("UPDATE temperature SET `temp_descr` = '$descr_hss2' WHERE `temp_host` = '$id' AND `temp_oid` = '$oid_hss2'");