<%
'Only write since-date if it's been down
If > 0 then Response.Write("since ")
%> |
|
|
Last: Avg: Max: Min: |
">
Up: Down: |
<%
'---Clear out our variables
intResponse = 0
strGraphType = ""
'---Let ServersAlive show the appropriate code for this check
intResponse = 0
strResponse = "0"
strResponse = ("")
If inStr(strResponse,"B") then
strResponse = LEFT(strResponse, inStr(strResponse,"B")-2)
intResponse = cdbl(strResponse)
End If
SELECT CASE strThisCheckType
CASE "DISKSPACE"
intStart = inStr(1,"","{")
intEnd = inStr(1,"","}")
If intStart > 0 AND intEnd > 0 then
'Set intMax as the total drive space, taken from the server pretty name
intMax = cdbl(Mid("",intStart+1,(intEnd-intStart-1)))
'Set intMin as the threshold, but we have to strip out SA's text
intMin = cdbl(Mid("",2,(Len("") - 2)))
strGraphType = "PIE"
End If
CASE "IPXPING","PING","URL"
'Pull the alphanumeric "ms" stuff out of SA's responses
intEnd = inStr(1,"","m")
If intEnd <> 0 then intResponse = cdbl(Mid("",1,(intEnd-1))) else intResponse = 0
intEnd = inStr(1,"","m")
If intEnd <> 0 then intMin = cdbl(Mid("",1,(intEnd-1))) else intMin = 0
intEnd = inStr(1,"","m")
If intEnd <> 0 then intMax = cdbl(Mid("",1,(intEnd-1))) else intMax = 0
intEnd = inStr(1,"","m")
If intEnd <> 0 then intAvg = cdbl(Mid("",1,(intEnd-1))) else intAvg = 0
strGraphType = "SPEEDO"
END SELECT
'---Now we render the graphs
Select Case strGraphType
Case "BAR"
'Calculate the response & max as percentages, so all the bars are exactly 100 pixels wide
intGreen = Round(intResponse / intMax * 100,0)
intRed = 100 - intGreen
'If it's down, color the used space red. Otherwise, color it yellow.
If "" = "DOWN" then
'The status is down, so color the used space red.
Response.Write(" ")
ElseIf intResponse < (intMin * 1.2) then
'The used space is getting within 20% of the threshold.
Response.Write(" ")
Else
Response.Write(" ")
End If
Response.Write("![]() ")
Response.Write(Round(intResponse/1000000,0) & " MB (" & intGreen & "%) free of " & Round(intMax/1000000,0) & " MB")
Case "PIE"
'Write the basic applet params
Response.Write("")
Case "SPEEDO"
Response.Write("")
End Select
%> |
<%
End If 'If (Request.Cookies("CheckType....
%>