<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%server.ScriptTimeout =480
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("cansetserver")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="ID应该是数字！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsserver = Server.CreateObject("ADODB.Recordset")
Sql="Select * from FreeHost.FreeHost_ServerVPSlist where id='"&Request("id")&"'"
		dsserver.Open Sql,conn,1,1
If dsserver.Eof Then
	ef=True
	ec="服务器不存在。"
end if
end if

if not ef then
URL=dsserver("site")
FreeHostsharekey=dsserver("FreeHostsharekey")

%><!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="80" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="servervpslist.asp"><font color="#FFFFFF">服务器管理</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF"><br>
<br>

	    <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left">
<%if request("op")="iops" then
varcon="vpsanalog enableallno makecsv"
temp=VPSOP(URL,FreeHostsharekey,varcon,0)
arrstr=Split(temp,"AggregatedDiskDataWritten")
arrstr2=Split(arrstr(1),"完成")
temp=Replace(arrstr2(0),vbcrlf&vbcrlf,vbcrlf)
'response.write "<pre>"&temp&"</pre>"
arrstrX=Split(temp,vbcrlf)
'#VMName,VMId,MeteringDuration,AvgCPU,CPUUsage,AvgRAM,MinRAM,MaxRAM,TotalDisk,VMTotalTraffic,AggregatedAverageNormalizedIOPS,AggregatedAverageLatency,AggregatedDiskDataRead,AggregatedDiskDataWritten<br>

%>
<table width="968" border="0" cellspacing="1" align="center" bgcolor="#CCCCCC">
  <tr align="center" valign="middle" bgcolor="#EEEEEE">
    <td width="35" height="29">序号</td>
    <td width="79" height="29">云服务器名</td>
    <td width="58" height="29">平均CPU<br>
      MHZ</td>
    <td width="58">平均使用内存</td>
    <td width="58">最小内存</td>
    <td width="58">最大内存</td>
    <td width="58">总硬盘M</td>
    <td width="58">总流量M</td>
    <td width="58">流入流量</td>
    <td width="58">流出流量</td>
    <td width="59">合计平均硬盘IOPS</td>
    <td width="58">合计平均硬盘等待时间</td>
    <td width="58">合计平均硬盘读</td>
    <td width="43">合计平均硬盘写</td>
	<td width="100">交换机名<br>
	  MAC地址/IP</td>
  </tr>
  <%

i=0
For i=0 To UBound(arrstrX)
arY=Split(arrstrX(i),",")
If UBound(arY)>3 Then
timeuseAry=Split(arY(2),".")
'timeuse=""
If UBound(timeuseAry)>0 Then timeuse=timeuseAry(0)
%>
  <tr align="center" bgcolor="#FFFFFF" onmouseover=this.bgColor='#E4EAF2'; onmouseout=this.bgColor='#FFFFFF';>
    <td height="30"><%=i%></td>
    <td title="唯一ID：<%=arY(1)%>"><a href="handvps1.asp?vpsname=<%=arY(0)%>" target="_blank"><font color="#FF0000"><%=arY(0)%></font></a></td>
    <td><%=arY(3)%></td>
    <td><%=arY(5)%></td>
    <td><%=arY(6)%></td>
    <td><%=arY(7)%></td>
    <td><%=arY(8)%></td>
    <td><%=arY(9)%></td>
    <td><%=arY(10)%></td>
    <td><%=arY(11)%></td>
    <td><%=arY(12)%></td>
    <td><%=arY(13)%></td>
    <td><%=arY(14)%></td>
    <td><%=arY(15)%></td>
	<td><%=Replace(Replace(Replace(Replace(arY(16),"!","<br>MAC："),"@","<br>IP:"),"[",""),"]","")%></td>
  </tr>
  <%
End if
NEXT

%>
</table>
<div align="center"><br> 
  星外云服务器精准分析，本数据采集的时段长度为：<%=timeuse%>(小时：分：秒)</div><br>
    <%end if%>			
    <%if request("op")="bps" Then
    
	If dsserver("OStype")="Windows Server 2012R2" Or dsserver("OStype")="Windows Server 2016" Then %>
	Windows Server 2012R2操作系统请用另一个功能查看
	<%else
	%>
    如果下面显示的流量是空的,请先在服务器上,<br>
  

<p>开始中,点管理,点可靠性和性能监视器</p>
<p>点左边的性能监视器,再点+号,点Hyper-V Virtual Switch Port,点添加,再点确定,然后,</p>
<p>等候一分钟,再关闭可靠性和性能监视器,</p>
再刷新本网页,显示就会正常.只有显示为云服务器名是才是VPS流量，其他的是操作系统默认的端口流量。<br>
<br>
<table width="500" border="0" cellspacing="1" align="center" bgcolor="#CCCCCC">
  <tr align="center" valign="middle" bgcolor="#EEEEEE">
    <td width="9%" height="29">序号</td>
    <td width="15%" height="29">云服务器名</td>
    <td width="20%" height="29">当前带宽(1秒)</td>
    <td width="23%" height="29">当前带宽5秒平均</td>
    <td width="33%" height="29">这个VPS启动以来的总流量</td>
  </tr>

              <%



'if Request("op")="startimail" then Response.Write SystemNetStop(URL,FreeHostsharekey,"IWEBMSG")

varcon="getcpu now list all"

response.write "<!--"&temp&"-->"

temp=VPSOP(URL,FreeHostsharekey,varcon,0)
temp=Replace(temp,"命令成功执行。","")
temp=Replace(temp,"portname,bps,bpsnow,totalbyte","")
arrstr=Split(temp,"性能数据:")

'response.write arrstr(0)



'response.write arrstr(1)

'response.write "ok----2-------------"

'response.write arrstr(2)

temp=Replace(arrstr(2),vbcrlf&vbcrlf,vbcrlf)
'temp=Replace(temp,"<br><br>","<br>")

arrstr=Split(temp,vbcrlf)

i=0

For i=0 To UBound(arrstr)
If arrstr(i)<>"" And arrstr(i)<>vbcrlf Then

'response.write arrstr(i)

arY=Split(arrstr(i),",")
If UBound(arY)>2 Then

Avpsn=Split(arY(0),"_")

'If Avpsn(UBound(Avpsn))<>"InternalPort" And Avpsn(UBound(Avpsn))<>"ExternalPort" Then i=i+1
vpsname=Avpsn(UBound(Avpsn))
If vpsname="InternalPort" Then vpsname="内部端口"
If vpsname="ExternalPort" Then vpsname="扩展端口"
%>
<tr align="center" bgcolor="#FFFFFF" onmouseover=this.bgColor='#E4EAF2'; onmouseout=this.bgColor='#FFFFFF';>
  <td height="30"><%=i%></td>
  <td><%=vpsname%></td>  
  <td><%=arY(1)%></td> 
  <td><%=arY(2)%></td>
  <td><%=Fix((arY(3)/1024/1024))%>M</td>  
</tr>

<%End If

End If

next


%>

</table>
<br>
<!--7i24iislog4 getcpu now list all-->
<%end if%>
<%end if%></td>
          </tr>
        </table>

</TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%=htmlwrite("html10")%>
<%
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if
%>
