<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% OPTION EXPLICIT %> <% 'If they picked a servertype & checktype, set it as a cookie for next time If Request.Form("ServerType") <> "" then Response.Cookies("ServerType") = Request.Form("ServerType") Response.Cookies("ServerType").Expires = Date + 365 Response.Cookies("CheckType") = Request.Form("CheckType") Response.Cookies("CheckType").Expires = Date + 365 End If If Request.Cookies("ServerType") = "" then Response.Cookies("ServerType") = "%" Response.Cookies("ServerType").Expires = Date + 365 End If If Request.Cookies("CheckType") = "" then Response.Cookies("CheckType") = "%" Response.Cookies("CheckType").Expires = Date + 365 End If 'Set up variables Dim strLabel Dim intFullSize Dim intResponse Dim strResponse Dim intGreen Dim intRed Dim intStart Dim intEnd Dim intMin Dim intMax Dim intAvg Dim strThisServerType Dim strThisCheckType Dim strGraphType %> ServersAlive Status with Groups & Filtering & Graphs
ServersAlive Status for    

As Of

<% 'Strip out the server type from the pretty name strThisServerType = "" strThisCheckType = "DISKSPACE"strThisCheckType = "EXTERNAL"strThisCheckType = "IPXPING"strThisCheckType = "NETWARE"strThisCheckType = "ORACLE"strThisCheckType = "PING"strThisCheckType = "PROCESS"strThisCheckType = "SERVICE"strThisCheckType = "NETWARE"strThisCheckType = "SQL"strThisCheckType = "UDP"strThisCheckType = "URL"strThisCheckType = "WINSOCK" intStart = inStr(1,"","[") intEnd = inStr(1,"","]") If intStart > 0 AND intEnd > 0 then strThisServerType = Mid("",intStart+1,(intEnd-intStart-1)) End If 'Filter out what to show If (Request.Cookies("CheckType") = "%" OR Request.Cookies("CheckType") = strThisCheckType) AND (Request.Cookies("ServerType") = "%" OR InStr(strThisServerType,Request.Cookies("ServerType")) OR strThisServerType = "") then %> <% End If 'If (Request.Cookies("CheckType.... %>
Group:
Status Pretty Name Check & Response Roundtrip Specs Uptime Graph
<% '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("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") 'Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") 'Write the customized data line Response.Write("") 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("") Case "SPEEDO" Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") 'Write the customized data line Response.Write("") 'If the check is down, color it red. If "" = "DOWN" then Response.Write("") ElseIf (intResponse > (intAvg * 1.2)) AND (intMax > (intAvg * 1.5)) then 'It's running 20% higher than average AND this isn't a consistently high check, so we'll color it yellow as a warning Response.Write("") Else 'Things are normal, make it green Response.Write("") End If Response.Write("") End Select %>

ServersAlive Version . cycles since started.