";
while($row=@mysqli_fetch_array($res))
{
$instanceNo=$row[instanceNo]+0;
$module[SMPPLink][$instanceNo][Name][Value]="[{$row[initValue]}]";
//echo "$instanceNo-{$row[initValue]}
";
}
for($row=0;$row<4;$row++)
{
for($col=0;$col<8;$col++)
{
$no=$row*8+$col;
$status=substr($smpp_link_status_hex,$no*2,2);
$istatus=hexdec($status)+0;
if($istatus>=0&&$istatus<5)
{
$module[SMPPLink][$no][Status][Value]=$smpp_link_status_label[$istatus];
$module[SMPPLink][$no][Status][Color]=$smpp_link_status_color[$istatus];
}
else
{
$module[SMPPLink][$no][Status][Value]="--";
$module[SMPPLink][$no][Status][Color]="#000000";
}
}
}
break;
//IWF
case 384:
//License
$module[License][Value]=hexdec(changeByteOrder(substr($detailStat,62,8)));
$module[License][Color]="#0000ff";
$module[License][Display]="block";
//User
$module[User][Value]=hexdec(changeByteOrder(substr($detailStat,70,8)));
$module[User][Color]="#0000ff";
$module[User][Display]="block";
break;
//VIM
case 389:
//Used Count
$module[UsedCount][Value]=hexdec(substr($detailStat,86,4));
$module[UsedCount][Color]="#0000ff";
$module[UsedCount][Display]="block";
break;
default:
break;
}
return $module;
}
function GetPlatInfo($conf,$sysNo)
{
global $pubConn;
$sql="select detailStat from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$conf[PlatNo]} and subSysNo=$sysNo ";
//echo "$sql
";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num != 1)
{
return 0;
}
$row=@mysqli_fetch_array($res);
$baseStat=$row[detailStat];
$compStat=substr($baseStat,38);
$compStatLen=strlen($compStat)-1;
//echo "$compStat
";
$index=0;
$i=0;
while($i<$compStatLen)
{
$tmp=substr($compStat,$i,4);
$component[$index][ID]=$tmp+0;
$i+=4;
$tmp=substr($compStat,$i,4);
$component[$index][Length]=hexdec($tmp);
$i+=4;
$component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2);
$i+=$component[$index][Length]*2;
$index++;
}
//echo "";
//print_r($component);
//echo "
";
if($component[8][Length] > 0)
{
$snmp_hb=$component[8][Content];
//echo "{$component[8][Length]}
$snmp_hb
";
//Start Time
$pos=0;
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$plat[StartTime][Value]=date("Y-m-d H:i:s",$tmpValue);
$plat[StartTime][Color]="#0000ff";
$plat[StartTime][Display]="block";
$pos+=8;
//CPU Use Rate
$tmpValue=100-hexdec(substr($snmp_hb,$pos,2));
$plat[CPURate][Value]="{$tmpValue}%";
$plat[CPURate][Color]="#000000";
$plat[CPURate][Display]="block";
//CPU Use Rate Process Num
$plat[CPURatePN][Value]=floor($tmpValue/10);
$plat[CPURatePN][Color]="#0000ff";
$plat[CPURatePN][Display]="Rect";
$pos+=2;
//Physical Memory Used/Total
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue1=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue2=floor(($tmpValue/$tmpValue1)*100);
$plat[PMTotalRate][Value]="{$tmpValue2}%";
$plat[PMTotalRate][Color]="#000000";
$plat[PMTotalRate][Display]="block";
$plat[PMTotalRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M";
$plat[PMTotalRateV][Color]="#000000";
$plat[PMTotalRateV][Display]="block";
$plat[PMTotalRatePN][Value]=floor($tmpValue2/10);
$plat[PMTotalRatePN][Color]="#0000ff";
$plat[PMTotalRatePN][Display]="Rect";
//Physical Memory Used/Swap
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue1=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue2=floor(($tmpValue/$tmpValue1)*100);
$plat[PMSwapRate][Value]="{$tmpValue2}%";
$plat[PMSwapRate][Color]="#000000";
$plat[PMSwapRate][Display]="block";
$plat[PMSwapRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M";
$plat[PMSwapRateV][Color]="#000000";
$plat[PMSwapRateV][Display]="block";
$plat[PMSwapRatePN][Value]=floor($tmpValue2/10);
$plat[PMSwapRatePN][Color]="#0000ff";
$plat[PMSwapRatePN][Display]="Rect";
//Physical Memory Buffers
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$plat[PMBuffers][Value]=(floor($tmpValue/1024))."M";
$plat[PMBuffers][Color]="#000000";
$plat[PMBuffers][Display]="block";
//Physical Memory Cached
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$plat[PMCached][Value]=(floor($tmpValue/1024))."M";
$plat[PMCached][Color]="#000000";
$plat[PMCached][Display]="block";
//Harddisk
$tmpValue=hexdec(substr($snmp_hb,$pos,2));
$pos+=2;
$plat[HDNum]=$tmpValue;
for($i=0;$i<$plat[HDNum];$i++)
{
$tmpValue=hexdec(substr($snmp_hb,$pos,2));
$pos+=2;
$path_len=$tmpValue;
$path="";
for($j=0;$j<$path_len;$j++)
{
$path.=chr(hexdec(substr($snmp_hb,$pos,2)));
$pos+=2;
}
$plat[HD][$i][Path][Value]="($path)";
$plat[HD][$i][Path][Color]="#000000";
$plat[HD][$i][Path][Display]="block";
$tmpValue=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue1=hexdec(substr($snmp_hb,$pos,8));
$pos+=8;
$tmpValue2=floor(($tmpValue/$tmpValue1)*100);
$plat[HD][$i][PN][Value]=floor($tmpValue2/10);
$plat[HD][$i][PN][Color]="#0000ff";
$plat[HD][$i][PN][Display]="Rect";
$plat[HD][$i][V][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M";
$plat[HD][$i][V][Color]="#000000";
$plat[HD][$i][V][Display]="block";
$plat[HD][$i][Rate][Value]="{$tmpValue2}%";
$plat[HD][$i][Rate][Color]="#000000";
$plat[HD][$i][Rate][Display]="block";
}
}
return $plat;
}
function GetProcessLabel($pn)
{
$sign="��";
$label="";
for($i=0;$i<$pn;$i++)
$label.=$sign;
return $label;
}
function GetLevel($objIdStr)
{
$levelArr=explode('.',$objIdStr);
for($j=0;$jlevelArr[$j]={$levelArr[$j]}";
if($j == 0){
$levelWhere ="level_$levelNo='${"level_$levelNo"}'";
}else{
$levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'";
}
}
return($levelWhere);
}
function GetDetailPlatInfo($sysNo,$subSysNo,$component_show_id)
{
$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$sysNo} and subSysNo={$subSysNo} ";
//echo "$sql
";
$res=mysqli_query($pubConn,$sql);
//$res=mysql_query($sql,$link);
$num=mysqli_num_rows($res);
if($num != 1)
{
return 0;
}
$row=@mysqli_fetch_array($res);
$refresh_time=$row[updateTime];
$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y")));
$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y")));
if($refresh_time < $due_date || $refresh_time > $ove_date)
{
$detailPlatInfo[RefreshTime][Value]="$refresh_time";
$detailPlatInfo[RefreshTime][Color]="#ff0000";
$valid_time=0;
}
else
{
$detailPlatInfo[RefreshTime][Value]="$refresh_time";
$detailPlatInfo[RefreshTime][Color]="#0000ff";
$valid_time=1;
}
$detailPlatInfo[IPAddress][Value]=$row[ip];
$detailPlatInfo[IPAddress][Color]="#000000";
//����
$status=$row[baseStat];
if($valid_time && $status)
{
$detailPlatInfo[Application][Status][Value]="Y";
$detailPlatInfo[Application][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[Application][Status][Value]="N";
$detailPlatInfo[Application][Status][Color]="#000000";
}
//����
$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$sysNo} and subSysNo={$subSysNo} ";
$res=mysqli_query($pubConn,$sql);
$num=mysqli_num_rows($res);
if($num < 1)
{
return 0;
}
$row=@mysqli_fetch_array($res);
$baseStat=$row[detailStat];
$compStat=substr($baseStat,38);
$compStatLen=strlen($compStat)-1;
//echo "$compStat
";
$index=0;
$i=0;
//����
$version_string=substr($row[detailStat],46,6);
if(strlen($version_string) < 6)
{
$detailPlatInfo[version][Status][Value]="--";
}
else
{
$detailPlatInfo[version][Status][Value]=(substr($version_string,0,2)+0).".".substr($version_string,2,2).".".substr($version_string,4,2);
$detailPlatInfo[version][Status][Color]="#0000FF";
}
//����
while($i<$compStatLen)
{
$tmp=substr($compStat,$i,4);
$component[$index][ID]=$tmp+0;
$i+=4;
$tmp=substr($compStat,$i,4);
$component[$index][Length]=hexdec($tmp);
$i+=4;
$component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2);
$i+=$component[$index][Length]*2;
$index++;
}
if(0)
{
echo "";
print_r($component);
echo "
";
}
//IPTRANS
$component_id=0;
if($component[$component_id][Length] > 0)
{
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[IPTRANS][Version][Value]=$newValue;
$detailPlatInfo[IPTRANS][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 1)
{
$detailPlatInfo[IPTRANS][Status][Value]="Y";
$detailPlatInfo[IPTRANS][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[IPTRANS][Status][Value]="N";
$detailPlatInfo[IPTRANS][Status][Color]="#FF0000";
}
$detail_flag=0;
if($component_show_id == $component_id)
{
$value=substr($component[$component_id][Content],8,8);
$value=hexdec($value);
$value=decbin($value);
$value=omc_keep_length($value,"0",32);
$test="";
for($i=0;$i<32;$i++)
{
if($value[$i] == "1")
{
$detailPlatInfo[IPTRANS][Port][$i][Status][Value]="Y";
$detailPlatInfo[IPTRANS][Port][$i][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[IPTRANS][Port][$i][Status][Value]="--";
$detailPlatInfo[IPTRANS][Port][$i][Status][Color]="#000000";
}
}
}
}
else
{
$detailPlatInfo[IPTRANS][Status][Value]="--";
$detailPlatInfo[IPTRANS][Status][Color]="#000000";
}
//MTP3
$component_id=1;
if($component[$component_id][Length] > 0)
{
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[MTP3][Version][Value]=$newValue;
$detailPlatInfo[MTP3][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 1)
{
$detailPlatInfo[MTP3][Status][Value]="Y";
$detailPlatInfo[MTP3][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[MTP3][Status][Value]="N";
$detailPlatInfo[MTP3][Status][Color]="#FF0000";
}
}
else
{
$detailPlatInfo[MTP3][Status][Value]="--";
$detailPlatInfo[MTP3][Status][Color]="#000000";
}
//SCCP
$component_id=2;
if($component[$component_id][Length] > 0)
{
$detailPlatInfo[SCCP][Status][sum]=$component[$component_id][Length]-4;
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[SCCP][Version][Value]=$newValue;
$detailPlatInfo[SCCP][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 2)
{
$detailPlatInfo[SCCP][Status][Value]="Y";
$detailPlatInfo[SCCP][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[SCCP][Status][Value]="N";
$detailPlatInfo[SCCP][Status][Color]="#FF0000";
}
if($component_show_id == $component_id)
{
for($i=8;$i<$component[$component_id][Length]*2;$i++)
{
if($i%2 == 0)
{
$value=hexdec(substr($component[$component_id][Content],$i,2));
$detailPlatInfo[SCCP][LocalNode][$value][Flag]=1;
$instanceNo=omc_keep_length($value,"0",4);
$sql_find="select initValue from OBJ_223.param_{$sysNo} where level_1=2 and level_2=2 and level_3=1 and level_4=1 and level_5=2 and level_6=0 and instanceNo='$instanceNo' ";
$res_find=mysqli_query($pubConn,$sql_find);
$num_find=mysqli_num_rows($res_find);
if($num_find < 1)
continue;
$row_find=@mysqli_fetch_array($res_find);
$detailPlatInfo[SCCP][LocalNode][$value][Value]=trim($row_find[initValue])." ";
$detailPlatInfo[SCCP][LocalNode][$value][Value1]=trim($row_find[initValue]);
$detailPlatInfo[SCCP][LocalNode][$value][Color]="#000000";
}
}
}
}
else
{
$detailPlatInfo[SCCP][Status][Value]="--";
$detailPlatInfo[SCCP][Status][Color]="#000000";
}
//TCAP
$component_id=3;
if($component[$component_id][Length] > 0)
{
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[TCAP][Version][Value]=$newValue;
$detailPlatInfo[TCAP][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 1)
{
$detailPlatInfo[TCAP][Status][Value]="Y";
$detailPlatInfo[TCAP][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[TCAP][Status][Value]="N";
$detailPlatInfo[TCAP][Status][Color]="#FF0000";
}
if($component_show_id == $component_id)
{
$detailPlatInfo[TCAP][CurrentUsedDialogueID][Value]=hexdec(substr($component[$component_id][Content],8,4));
$detailPlatInfo[TCAP][CurrentUsedDialogueID][Color]="#000000";
$detailPlatInfo[TCAP][MaxUsedDialogueID][Value]=hexdec(substr($component[$component_id][Content],12,4));
$detailPlatInfo[TCAP][MaxUsedDialogueID][Color]="#000000";
}
}
else
{
$detailPlatInfo[TCAP][Status][Value]="--";
$detailPlatInfo[TCAP][Status][Color]="#000000";
}
//SNMP
$component_id=4;
if($component[$component_id][Length] > 0)
{
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[SNMP][Version][Value]=$newValue;
$detailPlatInfo[SNMP][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 1)
{
$detailPlatInfo[SNMP][Status][Value]="Y";
$detailPlatInfo[SNMP][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[SNMP][Status][Value]="N";
$detailPlatInfo[SNMP][Status][Color]="#FF0000";
}
if($component_show_id == $component_id)
{
$detailPlatInfo[SNMP][TrapFuncCount][Value]=hexdec(substr($component[$component_id][Content],8,2));
$detailPlatInfo[SNMP][TrapFuncCount][Color]="#000000";
$detailPlatInfo[SNMP][SetFuncCount][Value]=hexdec(substr($component[$component_id][Content],10,2));
$detailPlatInfo[SNMP][SetFuncCount][Color]="#000000";
$detailPlatInfo[SNMP][GetFuncCount][Value]=hexdec(substr($component[$component_id][Content],12,2));
$detailPlatInfo[SNMP][GetFuncCount][Color]="#000000";
$detailPlatInfo[SNMP][RspFuncCount][Value]=hexdec(substr($component[$component_id][Content],14,2));
$detailPlatInfo[SNMP][RspFuncCount][Color]="#000000";
}
}
else
{
$detailPlatInfo[SNMP][Status][Value]="--";
$detailPlatInfo[SNMP][Status][Color]="#000000";
}
//DEBUG
$component_id=5;
if($component[$component_id][Length] > 0)
{
$value=substr($component[$component_id][Content],0,6);
$newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2);
$detailPlatInfo[DEBUG][Version][Value]=$newValue;
$detailPlatInfo[DEBUG][Version][Color]="#000000";
$value=hexdec(substr($component[$component_id][Content],6,2));
if($value == 1)
{
$detailPlatInfo[DEBUG][Status][Value]="Y";
$detailPlatInfo[DEBUG][Status][Color]="#0000FF";
}
else
{
$detailPlatInfo[DEBUG][Status][Value]="N";
$detailPlatInfo[DEBUG][Status][Color]="#FF0000";
}
if($component_show_id == $component_id)
{
$value=hexdec(substr($component[$component_id][Content],8,6));
$value=decbin($value);
$value=omc_keep_length($value,"0",24);
for($i=0;$i<24;$i++)
{
if($value[$i] == "1")
{
$detailPlatInfo[DEBUG][Module][$i][Value]="Y";
$detailPlatInfo[DEBUG][Module][$i][Color]="#0000FF";
}
else
{
$detailPlatInfo[DEBUG][Module][$i][Value]="--";
$detailPlatInfo[DEBUG][Module][$i][Color]="#000000";
}
}
}
}
else
{
$detailPlatInfo[DEBUG][Status][Value]="--";
$detailPlatInfo[DEBUG][Status][Color]="#000000";
}
//SMPP
$component_id=9;
if($component[$component_id][Length] > 0)
{
$detailPlatInfo[SMPP][Status][Value]="Y";
$detailPlatInfo[SMPP][Status][Color]="#0000FF";
if($component_show_id == $component_id)
{
$binstr="";
for($i=0;$i<8;$i++)
{
$value=hexdec(substr($component[$component_id][Content],$i*2,2));
$value=decbin($value);
$value=omc_keep_length($value,"0",8);
$binstr.=$value;
}
for($i=0;$i<32;$i++)
{
$value=substr($binstr,$i*2,2);
$value=bindec($value);
$detailPlatInfo[SMPP][SMPPLink][$i][Value]=$value;
}
}
}
else
{
$detailPlatInfo[SMPP][Status][Value]="--";
$detailPlatInfo[SMPP][Status][Color]="#000000";
}
if(0)
{
echo "";
print_r($detailPlatInfo);
echo "
";
}
return $detailPlatInfo;
}
?>