Page 1 sur 1

NotesAgent : run After Réplication

MessagePublié: 24 Mai 2011 à 16:18
par Michael DELIQUE
Bonjour

la base inetlockout ne gère pas les verrouillages dans le cadre d'un cluster. chaque serveur à sa propore base et son propre vérouillage.

résultat un utilisateur peut malgré le fait qu'il soit bloqué sur un server A du cluster se connecter au serveur B

IBM n'a pas de réponse (pour l'instant) pour cette grosse bouse !

résultat je dois codé un agent qui "synchronise" les document de verrouillage. pas de souci.

les différent base inetlockout réplique entre elles donc chacune a toutes les information concernant le verrouillage des autres (mais n'en fait rien bravo IBM)

mon souci ce situ au déclenchement de l'agent qui pour être parfait devrait ce faire apres chaque réplication... j'ai essaiyé apres chaque modif/creation de document mais ç'est pas top et j'aimerais eviter de faire tourner l'agent toutes les 5mn

MessagePublié: 24 Mai 2011 à 16:23
par d.bugger
Et si tu fais l'inverse : dans l'agent tu forces la réplication, puis tu mets à jour tout ce qu'il faut...?

MessagePublié: 24 Mai 2011 à 16:26
par Michael DELIQUE
ouaip

mais l'agent je le déclenche quand ? parceque là sur la modif de document ça se déclenche au "petit bonheur la chance"

et si j'ai 3 serveur ça va etre le bazar

MessagePublié: 24 Mai 2011 à 16:31
par d.bugger
Un agent planifié ? Qui utilise un seul document pour faire du "locking" entre les serveurs?

MessagePublié: 24 Mai 2011 à 16:33
par Michael DELIQUE
si agent planifier autant le faire tourner sur tout les servers

MessagePublié: 24 Mai 2011 à 16:46
par d.bugger
De la part d'IBM :
"Note When you replicate this database to other servers, the 'invalid attempts' information is calculated for each individual server. For example, if the threshold for 'John Doe' is three, and he has two invalid attempts on Server A and has one on Server B, he is not locked out of either server. The attempts are not combined for a total of three. The reason for replication is ease of administration, not to establish global thresholds."

Je ne sais pas si c'est possible de modifier le design de la base inetlockout, mais il y a l'outil TriggerHappy. Tu pourrais l'utiliser pour capturer un save() et modifier des champs. Mais si le save est fait en dur... :roll:

MessagePublié: 24 Mai 2011 à 16:52
par Michael DELIQUE
c'est une tache adminp qui renseign inetlockout... je n'ai aucun moyen de savoir quand elle est modifié. d'ou mon besoin apres chaque réplication. et mon agent est dans inetlockout

par contre je connais pas TriggerHappy , tu parle de ça => http://www.openntf.org/internal/home.ns ... er%20Happy

MessagePublié: 24 Mai 2011 à 16:59
par Michael DELIQUE
j'ai regardé TriggerHappy, mais l'idée d'installé un addon de ce type déplait fortement au client.

MessagePublié: 24 Mai 2011 à 17:07
par d.bugger
Tàf, et peut-être tu pourrais déclencher un agent spécial à l'enregistrement d'un doc dans inetlockout ? C'est juste une idée bizarre...

Donc, par exemple, à l'enregistrement, tu copies le doc pour chaque serveur dans le cluster, et après tu répliques..

Ah zut, pas de AddOn. Bon. :cry:

Tu as bien des problèmes complexes...

Il ne reste que mon idée d'avoir un agent par base qui fait la réplication. Désolé (bis)

MessagePublié: 25 Mai 2011 à 07:18
par Michael DELIQUE
re,

c'est pas que les addon ne sont pas autorisé (mais celui n'inspire pas confiance...)

pas ma décision

MessagePublié: 25 Mai 2011 à 09:13
par Michael DELIQUE
re,

le souci, c'est que le run after create/ipdate a un temp de déclenchement aléatoire. ça n'a rien d'immédiat

pour info la fonction que je teste

Code : Tout sélectionner
Function InetLockOutSynchroCluster(wlstServerCluster List As String, wCollection As NotesDocumentCollection) As Boolean
   
   Dim CollectionServer As NotesDocumentCollection
   Dim CollectionCluster As NotesDocumentCollection
   Dim lstDocCluster List As NotesDocument
   Dim DocServer As NotesDocument
   Dim DocCluster As NotesDocument
   Dim DocRef As NotesDocument
   Dim nmServer As NotesName
   Dim nmCluster As NotesName
   Dim nmUser As NotesName
   Dim nbTimeRef As Currency
   Dim i As Integer
   Dim nbSave As Boolean
   
   On Error GoTo CatchError
   
   InetLockOutSynchroCluster = false

   If Session Is Nothing Or DB Is Nothing Then
      Set Session = New NotesSession
      Set DB = Session.Currentdatabase
   End If

   If UCase(Trim(db.Filepath)) = UCase(Trim("test2\inetlockout2.nsf")) then
      Set nmServer = New NotesName("CN=NOTESTEST/O=AFER")
   Else
      Set nmServer = New NotesName(DB.server)
   End if
   REM rcupere les documents a traiter
   If wCollection Is Nothing then
      Set CollectionServer = DB.Search({Form = "UserLogin" & @name([CANONICALIZE];ILServerName)="}+nmServer.Canonical+{"},Nothing,0)
   Else
      Set CollectionServer = wCollection
   End if
   If CollectionServer Is Nothing Then
      Exit Function
   ElseIf CollectionServer.Count = 0 Then
      Set CollectionServer = Nothing
      Exit Function
   End If

   REM boucle sur chaque document à traiter
   Set DocServer = CollectionServer.Getfirstdocument()
   While Not DocServer Is Nothing
      Set nmUser = New NotesName(DocServer.Getitemvalue("ILUserName")(0))
      
      If Trim(CStr(DocServer.Getitemvalue("ILLastFailureTime")(0))) = "" Then
         nbTimeRef = CCur(Format(DocServer.Getitemvalue("ILFirstFailureTime")(0),"YYYYMMDDHHNNSS"))   
      Else
         nbTimeRef = CCur(Format(DocServer.Getitemvalue("ILLastFailureTime")(0),"YYYYMMDDHHNNSS"))
      End If      
      
      Set DocRef = DocServer
      
      i=0
      REM boucle pour chaque server du cluster
      ForAll Value In wlstServerCluster
         If Trim(CStr(Value)) <> "" Then
            Set nmCluster = New NotesName(Trim(CStr(Value)))
            REM si le serveur est différent su serveur en cours
            If UCase(Trim(nmServer.Abbreviated)) <> UCase(Trim(nmCluster.Abbreviated)) Then
               REM recherche les documents pour l'utilisateur et le serveur du cluster
               Set CollectionCluster = DB.Search({Form = "UserLogin" & @name([CANONICALIZE];ILServerName)="}+nmCluster.Canonical+{" & @name([CANONICALIZE];ILUserName)="}+nmUser.Canonical+{"},Nothing,0)
               If Not CollectionCluster Is Nothing Then
                  If CollectionCluster.Count > 0 Then
                     Set DocCluster = CollectionCluster.Getfirstdocument()
                  End If
               End If
               Set CollectionCluster = Nothing
               If DocCluster Is Nothing Then
                  REM si pas de document Alors le créé par copie et change juste le nom du serveur
                  Set DocCluster = DocServer.Copytodatabase(DB)
                  Call DocCluster.Replaceitemvalue("ILServerName",nmCluster.Canonical)
                  Call DocCluster.Save(True,False)      
                  InetLockOutSynchroCluster = True            
               Else
                  i=i+1
                  Set lstDocCluster(i) = DocCluster
                  If Trim(CStr(DocCluster.Getitemvalue("ILLastFailureTime")(0))) = "" Then
                     If nbTimeRef < CCur(Format(DocCluster.Getitemvalue("ILFirstFailureTime")(0),"YYYYMMDDHHNNSS")) Then
                        nbTimeRef = CCur(Format(DocCluster.Getitemvalue("ILFirstFailureTime")(0),"YYYYMMDDHHNNSS"))
                        Set DocRef = DocCluster
                     End If   
                  Else
                     If nbTimeRef < CCur(Format(DocCluster.Getitemvalue("ILLastFailureTime")(0),"YYYYMMDDHHNNSS")) Then
                        nbTimeRef = CCur(Format(DocCluster.Getitemvalue("ILLastFailureTime")(0),"YYYYMMDDHHNNSS"))
                        Set DocRef = DocCluster
                     End If
                  End If   
               End If
               Set DocCluster = Nothing
            End If
            Set nmCluster = Nothing
         End If
      End ForAll
      Set nmUser = Nothing
      
      If DocServer.Universalid <> DocRef.Universalid Then
         nbSave = false      
         If Trim(CStr(DocServer.Getitemvalue("ILAttempts")(0))) <> Trim(CStr(DocRef.Getitemvalue("ILAttempts")(0))) then
            Call DocServer.Replaceitemvalue("ILAttempts",DocRef.Getitemvalue("ILAttempts"))
            nbSave = true
         End If
         If Trim(CStr(DocServer.Getitemvalue("ILLockedOut")(0))) <> Trim(CStr(DocRef.Getitemvalue("ILLockedOut")(0))) Then
            Call DocServer.Replaceitemvalue("ILLockedOut",DocRef.Getitemvalue("ILLockedOut"))
            nbSave = True
         End If
         If Trim(CStr(DocServer.Getitemvalue("ILLastFailureTime")(0))) <Trim> 0 Then
         ForAll valueDoc In lstDocCluster
            Set DocCluster = valueDoc
            If Not DocCluster Is Nothing Then
               nbSave = False      
               If Trim(CStr(DocCluster.Getitemvalue("ILAttempts")(0))) <> Trim(CStr(DocRef.Getitemvalue("ILAttempts")(0))) Then
                  Call DocCluster.Replaceitemvalue("ILAttempts",DocRef.Getitemvalue("ILAttempts"))
                  nbSave = True
               End If
               If Trim(CStr(DocCluster.Getitemvalue("ILLockedOut")(0))) <> Trim(CStr(DocRef.Getitemvalue("ILLockedOut")(0))) Then
                  Call DocCluster.Replaceitemvalue("ILLockedOut",DocRef.Getitemvalue("ILLockedOut"))
                  nbSave = True
               End If
               If Trim(CStr(DocCluster.Getitemvalue("ILLastFailureTime")(0))) <> Trim(CStr(DocRef.Getitemvalue("ILLastFailureTime")(0))) Then
                  Call DocCluster.Replaceitemvalue("ILLastFailureTime",DocRef.Getitemvalue("ILLastFailureTime"))
                  nbSave = True
               End If
               If nbSave = True Then
                  InetLockOutSynchroCluster = true
                  Call DocCluster.Save(True,False)
               End If   
               Set DocCluster = nothing   
            End If
         End ForAll
      End If
      
      Set DocRef = Nothing
      Erase lstDocCluster
      
      Set DocServer = CollectionServer.Getnextdocument(DocServer)
   Wend

   Set nmServer = Nothing
   Set CollectionServer = Nothing

   Exit Function
CatchError:
   Msgbox "("+Structure_Log+" : "+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   InetLockOutSynchroCluster = false
   Exit Function
End Function

MessagePublié: 25 Mai 2011 à 14:17
par roubech
je crois me souvenir que messages de ta part il y a quelques mois concernant cette histoire de limiter le nombre de tentatives de connections web. Tu avais déjà exploré la piste de modifier ton CustomLoginForm dans la domcfg pour gérer ton propre compteur ?

MessagePublié: 25 Mai 2011 à 14:41
par Michael DELIQUE
re,

oui mais non, impossible de savoir si une connexion est réussi ou pas