Verificando Mail Cluster

Share

Verificar se um cluster Domino está todo “sincronizado” é trabalhoso. Existe uma ferramenta para analisar o cluster no Domino Administrator mas se um relatório mais detalhado for necessário a ferramenta não disponibiliza.
Achei um código que gera uma planilha, comparando os diretórios de dois servidores. As informações dos bancos de dados podem ser facilmente trocadas.
O script analisa, basicamente informações importantes para servidores de correio em cluster.
O código está abaixo pode ser colocado em um agente ou botão. Para evitar erros de acesso é bom executar como Full Administrator.

Sub Initialize
       
        On Error Resume Next
       
        Dim session As New notessession
       
        Dim Sdbdirectory As NotesDbDirectory
        Dim Sdb As NotesDatabase
        Dim Sfilepath As String
       
        Dim Ddbdirectory As NotesDbDirectory
        Dim Ddb As NotesDatabase
       
        Dim SrcServ As String
        Dim DestServ As String
        Dim rows As Long
        Dim maxcols As Integer
       
       
        SrcServ=Inputbox$(“Please enter the Source Server”,”Tools”,”Source Server”)
        DestServ=Inputbox$(“Please enter the Destination Server”,”Tools”,”Destination server”)
        Sfilepath=Inputbox$(“Please provide the folder path on source which needs to be checked e.g. mail or databases”,”Tools”,”mail”)
       
       
‘excel variable initialization
        Set xlApp = CreateObject(“Excel.Application”)
‘start Excel with OLE Automation
        xlApp.StatusBar = “Creating WorkSheet. Please be patient…”
        xlApp.Visible = True
        xlApp.Workbooks.Add
        xlApp.ReferenceStyle = 2
        Set xlsheet = xlApp.Workbooks(1).        Worksheets(1) ‘select first worksheet
‘=================================
‘worksheet title
       
        xlApp.StatusBar = “Creating Column Heading. Please be patient…”
       
        rows=2
        xlsheet.cells(rows,4)=SrcServ
        xlsheet.cells(rows,7)=DestServ
        rows=3
       
        xlsheet.Cells(rows,1).value=”Database File  ”
        xlsheet.Cells(rows,2).value=”Title”
       
        xlsheet.Cells(rows,3).value=”Mail Size (MB)”
        xlsheet.Cells(rows,4).value=”Mail Quota  (MB)”
        xlsheet.Cells(rows,5).value=”Warning Threshold  (MB)”
       
        xlsheet.Cells(rows,6).value=”Mail Size (MB)”
        xlsheet.Cells(rows,7).value=”Mail Quota  (MB)”
        xlsheet.Cells(rows,8).value=”Warning Threshold  (MB)”
        maxcols=8
        rows=4
‘=========================
       
       
        Set Sdbdirectory=session.GetDbDirectory(SrcServ)
        Set Ddbdirectory=session.GetDbDirectory(DestServ)
       
        Set Sdb=Sdbdirectory.GetFirstDatabase(DATABASE)
       
        While Not   Sdb Is Nothing
                repid=Sdb.ReplicaID
                tmpFilename= Strleftback(Sdb.FilePath,””)
               
                If tmpFilename=Sfilepath Then
                       
                        Set Ddb=New notesdatabase(“”,””)
                        flag  DDb.OpenByReplicaID(DestServ,repid)
                       
                        If flag=True  Then
                               
                                xlsheet.Cells(rows,1).Value = Sdb.FileName
                                xlsheet.Cells(rows,2).Value =”‘”+ Sdb.Title
                               
                                xlsheet.Cells(rows,3).Value =(Sdb.size/1000000)
                                xlsheet.Cells(rows,4).Value =Sdb.SizeQuota/1024
                                xlsheet.Cells(rows,5).Value =sdb.SizeWarning/1024
                               
                                xlsheet.Cells(rows,6).Value =(Ddb.size/1000000)
                                xlsheet.Cells(rows,7).Value =Ddb.SizeQuota/1024
                                xlsheet.Cells(rows,8).Value =Ddb.SizeWarning/1024
                               
                               
                               
                                xlApp.StatusBar = “Importing Notes Data – Document ” & rows-1  
                                Set DDb=Nothing    
                               
                        Else
                                xlsheet.Cells(rows,1).Value = Sdb.FileName
                                xlsheet.Cells(rows,2).Value =”‘”+ Sdb.Title
                               
                                xlsheet.Cells(rows,3).Value =(Sdb.size/1000000)
                                xlsheet.Cells(rows,4).Value =Sdb.SizeQuota/1024
                                xlsheet.Cells(rows,5).Value =sdb.SizeWarning/1024
                               
                                xlsheet.Cells(rows,6).Value =”Missing on destination server”
                               
                                xlApp.StatusBar = “Importing Notes Data – Document ” & rows-1  
                        End If
                        rows=rows+1
                End If
               
               
                Set Sdb=Sdbdirectory.GetNextDatabase()
               
        Wend
       
        xlApp.Rows(“1:1”).Select
        xlApp.Selection.Font.Bold = True
        xlApp.Selection.Font.Underline = True
        xlApp.Range(xlsheet.Cells(2,1),xlsheet.Cells(rows,maxcols)).Select
        xlApp.Selection.Font.Name = “Arial”
        xlApp.Selection.Font.Size = 9
        xlApp.Selection.Columns.AutoFit
        With xlApp.Worksheets(1)
                .PageSetup.Orientation = 2
                .PageSetup.centerheader = “Report – Confidential”
                .Pagesetup.RightFooter = “Page &P” & Chr$(13) & “Date: &D”
                Pagesetup.CenterFooter = “”
        End With
        xlApp.ReferenceStyle = 1
        xlApp.Range(“A1”).SelectxlApp.StatusBar = “Importing Data from Lotus Notes Application was Completed.”
       
       
        Set xlapp=Nothing ‘stop OLE
        Set db=Nothing
End Sub