1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
   | 'Si serveur triade
                sCmde = sDirlmstat & " -c " & slmsrv1 & " -f " & sModul & " > " & sDiracqfic & "\acqe_" & sSection & "_" & sFicTempAcq & ".txt" & vbLf & sDirlmstat & " -c " & slmsrv2 & " -f " & sModul & " >> " & sDiracqfic & "\acqe_" & sSection & "_" & sFicTempAcq & ".txt" & vbLf & sDirlmstat & " -c " & slmsrv3 & " -f " & sModul & " >> " & sDiracqfic & "\acqe_" & sSection & "_" & sFicTempAcq & ".txt"
                NumFich = FreeFile()
                FileOpen(NumFich, (sDiracqbat & "\acqe_" & sModul & ".bat"), OpenMode.Output)
                PrintLine(NumFich, sCmde)
                FileClose(NumFich)
                b = ExecuterCommandeDOS(sDiracqbat & "\acqe_" & sModul & ".bat")
            End If
        End If
 
Extract:
        'Extraction
        FileOpen(NumFich, (sDiracqfic & "\acqe_" & sSection & "_" & sFicTempAcq & ".txt"), OpenMode.Input)
RechFlex:
        'Recherche  " Flexible...
        texte = LineInput(NumFich)
        If EOF(1) = True Then GoTo Fin
        If Not InStr(1, texte, "Flexible License Manager status on", CompareMethod.Text) <> 0 Then GoTo RechFlex
        'Affectation de CrTime
        tbCrTime = Split(CrTime, "/")
        CrTime = tbCrTime(1) & "/" & tbCrTime(0) & "/" & tbCrTime(2)
        CrTime = Format(CrTime, "dd/mm/yyyy hh:mm")
 
        'Recherche  " Detecting...
RechDetect:
        texte = LineInput(NumFich)
        If EOF(NumFich) = True Then GoTo Fin
        If Not InStr(1, texte, "[Detecting lmgrd processes...]", CompareMethod.Text) <> 0 Then GoTo RechDetect
 
        CptSrv = CptSrv + 1
        'Recherche  " User of <sModul>...
        umod = "Users of " & sModul
        texte = LineInput(NumFich)
        If EOF(NumFich) = True Then GoTo RechErr
        If InStr(1, texte, umod, CompareMethod.Text) <> 0 Then GoTo ErrFound
 
RechErr:
        'Recherche  " Error...
        'Identification du serveur ... afin d'en déterminer l'erreur
        If InStr(1, texte, "Error", CompareMethod.Text) <> 0 And triad = False Then
            FileClose(NumFich)
            'UPGRADE_WARNING: Impossible de résoudre la propriété par défaut de l'objet a. Cliquez ici*: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            a = Shell(My.Application.Info.DirectoryPath & "\SendError.bat", 1)
            'Edition des messages d'erreurs dans le fichier .log en cas de serveur ...
            FileOpen(NumFich, (sDirlog & "\" & sSection & ".txt"), OpenMode.Append)
            TextErr = CrTime & "  erreur  " & texte
            PrintLine(NumFich, TextErr)
            FileClose(NumFich)
            b = ExecuterCommandeDOS(sDirexe & "\SendError.bat")
            GoTo Fin
        End If
 
 
 
 
        'Identification du serveur triade afin d'en déterminer l'erreur
        If InStr(1, texte, "Error", CompareMethod.Text) <> 0 And triad = True Then
            CptErr = CptErr + 1
 
        End If
        If CptErr = 1 Then
            If CptSrv = 1 Then
                TextErr = CrTime & "  information " & " Serveur triade en marche dégradée " & slmsrv2 & " " & slmsrv3
            End If
            If CptSrv = 2 Then
                TextErr = CrTime & "  information " & " Serveur triade en marche dégradée " & slmsrv1 & " " & slmsrv3
            End If
            If CptSrv = 3 Then
                TextErr = CrTime & "  information " & " Serveur triade en marche dégradée " & slmsrv1 & " " & slmsrv2
            End If
            FileClose(NumFich)
            FileOpen(NumFich, (sDirlog & "\" & sSection & ".txt"), OpenMode.Append)
            PrintLine(NumFich, TextErr)
            FileClose()
        Else
            GoTo Fin
        End If
        GoTo Extract
Fin:
        FileClose(NumFich)
 
        'Destruction du fichier d'acquisition
        Kill((sDiracqfic & "\acqe_" & sSection & "_" & sFicTempAcq & ".txt"))
 
        'Fin
    End Sub
End Module | 
Partager