%@ LANGUAGE="VBScript" %>
<%
timedate=Request("timedate")
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Mode = adModeRead
Connection.Open phdb_rd
If Not IsEmpty(request.form("Latest")) Then
timedate=""
End If
If timedate="" Then
SQLStmtX = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual "
Set RSX = Connection.Execute(SQLStmtX)
timedate = CStr(RSX("timedate"))
End If
' response.write(SQLStmtX)
Dim color(3)
color(0)="
<%
End If
timedate_par=replace(timedate," ","%20")
%>
FEC Monitoring Status
FEC Monitoring : Vfp Summary
<%
Set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = Connection
SQLStmt = " select to_char(ft.logdate,'MM/DD hh24:mi:ss') ddate,ft.fec_number,ft.fec_port, "
SQLStmt = SQLStmt & " 24*60*(to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-ft.logdate) ddif, "
SQLStmt = SQLStmt & " to_char(19.5*(ascii(fec_VFP)-127),9999.0) Vfp "
SQLStmt = SQLStmt & " from phoffline.fec_monitoring ft, "
SQLStmt = SQLStmt & " (select max(logdate) logdate,max(fec_number) fec_number,max(fec_port) fec_port "
SQLStmt = SQLStmt & " from phoffline.fec_monitoring "
SQLStmt = SQLStmt & " where logdate between to_date( ? ,'MM/DD/YYYY HH24:MI:SS')-0.1 and to_date( ? ,'MM/DD/YYYY HH24:MI:SS')"
SQLStmt = SQLStmt & " group by fec_number,fec_port) pt "
SQLStmt = SQLStmt & " where ft.logdate=pt.logdate "
SQLStmt = SQLStmt & " and ft.fec_number=pt.fec_number "
SQLStmt = SQLStmt & " and ft.fec_port=pt.fec_port "
SQLStmt = SQLStmt & " order by ft.fec_number,ft.fec_port "
' response.write(SQLStmt)
Cmd.CommandText = SQLStmt
Cmd.CommandType = 1
for i=0 To 2
Set prm = cmd.CreateParameter("Input" & CStr(i),adBSTR,adParamInput,20,timedate)
Cmd.Parameters.Append prm
Set prm=nothing
Next
Set RS = Cmd.Execute()
%>
FEC#
Last DB write
Vfp Port 0
Vfp Port 1
Vfp Port 2
Vfp Port 3
<%
old_fec_number = 0
count_latchedup_ports = 0
Do While Not RS.EOF
new_fec_number = CInt(RS("fec_number"))
If new_fec_number <> old_fec_number Then
'open a new row for this FEC
old_fec_number = new_fec_number
%>
<%=RS("fec_number")%>
<%
If CDbl(RS("ddif"))" & CStr(RS("ddate")) & "")
Else
Response.write("" & CStr(RS("ddate")) & "")
End If
%>
<%
End If
'make 4 buttons for Vfp of the 4 ports
Response.write("
" & vbCrLf)
If Not IsNull(RS("Vfp")) Then
vfp = CDbl(RS("Vfp"))
If vfp < -190 and vfp > -400 Then
' ok
Response.write( "" & CStr(RS("Vfp")) & "" & color(0))
End If
If (vfp < -20 and vfp > -190) or vfp < -400 Then
' something strange
Response.write( "" & CStr(RS("Vfp")) & "" & color(3))
End If
If vfp >= -20 Then
' not ok
Response.write( "" & color(1))
count_latchedup_ports = count_latchedup_ports + 1
End If
Else
Response.write( "XXXX" & color(2))
End If
Response.write("
" & vbCrLf)
If CInt(RS("fec_port")) = 3 Then
%>
<%
End If
RS.Movenext
Loop
%>
<%
If count_latchedup_ports > 0 Then
Response.write( "" )
End If
%>
<%
Connection.Close
Set RS=nothing
Set Connection=nothing
%>