<% '---------------------------------------------------------------------------- ' ' Function : GetHighestAlert ' ' Synopsis : Returns the level of the highest alert that is active ' ' Arguments: None ' ' Returns : Alert level ' ' Copyright (c) Microsoft Corporation. All rights reserved. ' '---------------------------------------------------------------------------- Function GetHighestAlert() on error resume next Err.Clear Dim objElement Dim objElementCol Dim intCurrentAlertType Dim intHighestAlertType Dim iAlertType intHighestAlertType = 0 Set objElementCol = GetElements("SA_Alerts") If objElementCol.Count=0 or Err.Number <> 0 Then Call SA_TraceOut(SA_GetScriptFileName(), "No alerts found...") Err.Clear Else For Each objElement in objElementCol iAlertType = objElement.GetProperty("AlertType") If ( Err.Number <> 0 ) Then Call SA_TraceOut(SA_GetScriptFileName(), "objElement.GetProperty(AlertType) Error: " + CStr(Hex(Err.Number)) + " " + Err.Description) Call SA_TraceOut(SA_GetScriptFileName(), "For Alert ElementID: " + CStr(objElement.GetProperty("ElementID"))) Err.Clear Else 'Call SA_TraceOut(SA_GetScriptFileName(), "AlertType: " + CStr(iAlertType)) Select Case (iAlertType) Case 0 intCurrentAlertType = 2 'warning Case 1 intCurrentAlertType = 1 'critical Case 2 intCurrentAlertType = 3 'informational Case else intCurrentAlertType = 3 'informational Call SA_TraceOut(SA_GetScriptFileName(), "Unexpected AlertType: " + CStr(iAlertType)) End Select If intHighestAlertType = 0 Then intHighestAlertType = intCurrentAlertType Else If intHighestAlertType > intCurrentAlertType Then intHighestAlertType = intCurrentAlertType End If End If End If Next End If Set objElement = Nothing Set objElementCol = Nothing GetHighestAlert = intHighestAlertType End Function Dim imagePath Dim StatusText Dim StatusClass Dim L_NORMAL_TEXT Dim L_CRITICAL_TEXT Dim L_WARNING_TEXT Dim L_INFORMATION_TEXT Dim L_STATUS_TEXT Dim L_PAGETITLE_TEXT Dim L_PAGE_STATUS_TEXT L_PAGETITLE_TEXT = GetLocString("sacoremsg.dll", "40200BBF", "") L_PAGE_STATUS_TEXT = SA_EncodeQuotes(GetLocString("sacoremsg.dll", "40200BC0", "")) L_NORMAL_TEXT = GetLocString("sacoremsg.dll", "40200BC1", "") L_CRITICAL_TEXT = GetLocString("sacoremsg.dll", "40200BC2", "") L_WARNING_TEXT = GetLocString("sacoremsg.dll", "40200BC3", "") L_INFORMATION_TEXT = GetLocString("sacoremsg.dll", "40200BC4", "") L_STATUS_TEXT = GetLocString("sacoremsg.dll", "40200BC5", "") Dim iHighestAlert iHighestAlert = GetHighestAlert() 'Call SA_TraceOut(SA_GetScriptFileName(), "Highest AlertType: " + CStr(iHighestAlert)) Select Case iHighestAlert Case 0 'none imagePath = "" StatusText = L_NORMAL_TEXT StatusClass = "StatusNormal" Case 1 'critical imagePath = "images/critical_error.gif" StatusText = L_CRITICAL_TEXT StatusClass = "StatusCritical" Case 2 'warning imagePath = "images/alert.gif" StatusText = L_WARNING_TEXT StatusClass = "StatusWarning" Case 3 'informational imagePath = "images/information.gif" StatusText = L_INFORMATION_TEXT StatusClass = "StatusInformational" Case Else Call SA_TraceOut(SA_GetScriptFileName(), "Unexpected alert type: " + CStr(iHighestAlert)) imagePath = "" StatusText = L_NORMAL_TEXT StatusClass = "StatusNormal" End Select Dim strStatusPageURL strStatusPageURL = "/admin/statuspage.asp?Tab1=TabsStatus&" & _ SAI_FLD_PAGEKEY & "=" & SAI_GetPageKey() %> <% Call SA_EmitAdditionalStyleSheetReferences("") %> <%=L_PAGETITLE_TEXT%> <% If imagePath <> "" Then %> <% End If %>
<%=L_STATUS_TEXT%>: <%=StatusText%>