VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper

by Anonymous (267 Submissions)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXperts Network Monitor uses VBScript functions

Rate Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper



' This function checks if the local SMTP queuelength is not exceeding 
' numMaxQueueLength.
' You should expect this figure to be fairly small, rarely more than 0. 
' If it is consistently higher than this, yourSMTP service is not working well.

On Error Resume Next

    Dim objWMIService, nMax, strComputerObject, colSMTP, o

    nMax = 0
    Set objWMIService = GetObject( "winmgmts://" & strComputer )
    If( Err.Number <> 0 ) Then
Check_Length_SMTPQueue = retvalUnknown
EXPLANATION = "Unable to access '" & strComputer & "'. Possible reasons: no WMI installed on the remote server, no rights to access remote WMI service, or remote server down"
Exit Function
    End If

    Set colSMTP = objWMIService.InstancesOf( "Win32_PerfRawData_SMTPSVC_SMTPServer"  )

    For Each o in colSMTP

        If( Err.Number <> 0 ) Then
    Check_Length_SMTPQueue = retvalUnknown
    EXPLANATION = "Unable to list smtp servers"
    Exit Function
        End If

        If( InStr( UCase( o.Name ), "SMTP" ) ) Then
            If( o.LocalQueueLength > numMaxQueueLength ) Then
                Check_Length_SMTPQueue = False
                EXPLANATION = "SMTP Local Queue Length (" & o.LocalQueueLength & ") exceeds " & numMaxQueueLength
                Exit Function
            Else
                Check_Length_SMTPQueue = True
                EXPLANATION = "SMTP Local Queue Length less than " & numMaxQueueLength
                Exit Function
            End If
        End If
    Next

    Check_Length_SMTPQueue = True
    EXPLANATION = "SMTP service not installed"

End Function

Download this snippet    Add to My Saved Code

Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper Comments

No comments have been posted about Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper. Why not be the first to post a comment about Exchange 2000 monitor rule - this code is part of the ActiveXperts Network Monitor tool. ActiveXper.

Post your comment

Subject:
Message:
0/1000 characters