Bonjour
j'ai besoin de récupérer l'historique de réplication en Lotus script (ou en Java)
les seules méthodes que j'ai trouvé passent pas des API, mais aucuen ne fonctionnent sur des serveur en 64 bits...
Merci
Bonjour
j'ai besoin de récupérer l'historique de réplication en Lotus script (ou en Java)
les seules méthodes que j'ai trouvé passent pas des API, mais aucuen ne fonctionnent sur des serveur en 64 bits...
Merci
Pourquoi les appels à l’api ne fonctionneraient? Pas eu de pbs de 853 à la 10 sous win64 et centos64? Tu as quoi comme erreur?
ben euh... justement j'ai pas d'erreur...
le code ne renvois juste rien quand il tourne sur serveur et quelque chose quand je le lance à la main...
vla le bazar
Code VBA : Sélectionner tout - Visualiser dans une fenêtre à part
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206 Public Function ReplicationHistory_API(wServer As String, wPathFile As String) As Variant Dim fullPath As String*256 Dim nbHandleDB As Long Dim nbHandleLock As Long Dim nbHandleReplique As Long Dim nbReturn As Long Dim nbEntries As Long Dim nbEntries2 As Long Dim i As Long Dim j As Long Dim entry() As HIST_ENTRY Dim summary As REPLHIST_SUMMARY Dim eTemp As HIST_ENTRY Dim TexteRetour As String*81 Dim nbLen As Integer Dim Hold As String Dim Temp As String Dim lstRetour List As String Dim nbPos As Long Dim nmServer As NotesName Dim ErrorText As String %REM Public Type TIMEDATE innards (1) As Long End Type Type HIST_ENTRY RepTime As Variant ServerName As Variant FileName As String Direction As Integer DirectionLabel As String End Type Type REPLHIST_SUMMARY ReplicationTime As TIMEDATE AccessLevel As Integer AccessFlags As Integer Direction As Integer ServerNameOffset As Long ServerNameLength As Integer FileNameLength As Integer Spare1 As Long Spare2 As Long End Type Declare Function W32_OSPathNetConstruct Lib "nnotes.dll" Alias "OSPathNetConstruct"(ByVal portName As Integer, ByVal serverName As String, ByVal fileName As String,ByVal pathName As String) As Integer Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen"(ByVal dbName As String, hDb As Long) As Integer Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" (ByVal hDb As Long) As Integer Declare Function NSFDbGetReplHistorySummary Lib "NNOTES" Alias "NSFDbGetReplHistorySummary" (ByVal H As Long, ByVal F As Long, retSum As Long, retNum As Long) As Integer Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As REPLHIST_SUMMARY, ByVal pSource As Long, ByVal dwLength As Long) Declare Sub CopyMemoryStr Lib "kernel32" Alias "RtlMoveMemory" (ByVal pDest As String, ByVal pSource As Long, ByVal dwLength As Long) Declare Function OSLockObject Lib "NNOTES" Alias "OSLockObject" (ByVal H) As Long Declare Sub OSUnlockObject Lib "NNOTES" Alias "OSUnlockObject" (ByVal H) Declare Function OSMemFree Lib "NNOTES" Alias "OSMemFree" (ByVal H As Long) As Integer Declare Function ConvertTIMEDATEToText Lib "NNOTES" (ByVal IntlFormat As Integer, ByVal TimeFormat As Integer, InputTime As TIMEDATE, ByVal retTextBuffer As String, ByVal TextBufferLength As Integer, retTextLength As Integer) As Integer %END REM Const DIRECTION_NEVER=0 Const DIRECTION_SEND=1 Const DIRECTION_RECEIVE=2 Const Separator = "|" On Error GoTo CatchError ReplicationHistory_API = Null If Trim(wPathFile) = "" Then REM Error 9999,"wPathFile is Empty" Exit Function End If If Trim(wServer) = "" Then ErrorText= " (Local!!"+Trim(wPathFile)+")" Else Set nmServer = New NotesName(Trim(wServer)) ErrorText= " ("+nmServer.Abbreviated+"!!"+Trim(wPathFile)+")" Set nmServer = Nothing End If Call W32_OSPathNetConstruct(0, Trim(wServer),Trim(wPathFile), fullPath) nbReturn = NSFDbOpen(fullPath, nbHandleDB) If nbReturn <> 0 Then Error 9999,"Couldn't open database" Exit Function End If nbReturn = NSFDbGetReplHistorySummary(nbHandleDB, 0, nbHandleReplique, nbEntries) If nbReturn <> 0 Then If nbHandleDB <> 0 Then nbReturn = NSFDbClose(nbHandleDB) End If REM Error 9999,"Couldn't open replication history on database" Exit Function End If If nbEntries > 0 Then nbEntries2 = nbEntries - 1 ReDim entry(0 To nbEntries2) nbHandleLock=OSLockObject(nbHandleReplique) For i=0 To nbEntries2 CopyMemory summary, nbHandleLock, LenB(summary) nbLen =0 nbReturn = ConvertTIMEDATEToText(0, 0, summary.ReplicationTime, TexteRetour, Len(TexteRetour)-1, nbLen) entry(i).RepTime = Left$(TexteRetour, nbLen) Select Case summary.Direction Case 0 entry(i).Direction=DIRECTION_NEVER entry(i).DirectionLabel="Never" Case 1 entry(i).Direction=DIRECTION_SEND entry(i).DirectionLabel="Send" Case 2 entry(i).Direction=DIRECTION_RECEIVE entry(i).DirectionLabel="Receive" Case Else entry(i).Direction=-1 entry(i).DirectionLabel="" End Select nbHandleLock=nbHandleLock+Lenb(summary) Next Hold = "" Temp = String(1, 0) i=0 Do While i < nbEntries Call CopyMemoryStr (temp,nbHandleLock,1) If Temp = Chr(0) Then REM And (InStr(1, Hold, "!!") <> 0 nbPos=InStr(1, Hold, "!!")-1 Set nmServer = New NotesName(Left(Hold, nbPos)) entry(i).ServerName=nmServer.canonical entry(i).FileName=Right(Hold, Len(Hold)-nbPos) Hold="" i=i + 1 Else Hold=Hold + Temp End If nbHandleLock = nbHandleLock + 1 Loop OSUnlockObject(nbHandleReplique) nbEntries2 = nbEntries - 2 Do j=0 For i=0 To nbEntries2 If entry(i).RepTime < entry(i+1).RepTime Then j=j+1 eTemp=entry(i) entry(i)=entry(i+1) entry(i+1)=eTemp ElseIf entry(i).RepTime = entry(i+1).RepTime Then If entry(i).ServerName > entry(i+1).ServerName Then j=j+1 eTemp=entry(i) entry(i)=entry(i+1) entry(i+1)=eTemp End If End If Next Loop While j > 0 nbEntries2 = nbEntries - 1 For i=0 To nbEntries2 lstRetour(i) = Trim(CStr(entry(i).RepTime))+(Separator)_ +Trim(CStr(entry(i).Direction))+(Separator)_ +Trim(CStr(entry(i).DirectionLabel))+(Separator)_ +Trim(CStr(entry(i).ServerName))+(Separator)_ +Trim(CStr(entry(i).FileName)) Next ReplicationHistory_API = lstRetour Erase lstRetour End If Erase entry If nbHandleReplique > 0 Then OSUnlockObject(nbHandleReplique) rem OSMemFree (nbHandleReplique) End If nbReturn = NSFDbClose(nbHandleDB) REM OSMemFree (nbHandleDB) If nbReturn <> 0 Then Error 9999,"Couldn't close database" Exit Function End If Exit Function CatchError: MsgBox "("+Structure_Log+" : "+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !" Call ErreurGestion(ErrorAction,"", "","",Nothing,"","", Structure_Log, CStr(GetThreadInfo(10)), CStr(GetThreadInfo (1)), CStr(Err),CStr(Error),CStr(Erl),Nothing,"",False) ReplicationHistory_API = Null On Error Resume Next If nbHandleReplique > 0 Then OSUnlockObject(nbHandleReplique) rem OSMemFree (nbHandleReplique) End If If nbHandleDB <> 0 Then nbReturn = NSFDbClose(nbHandleDB) REM OSMemFree (nbHandleDB) End If Exit Function End Function
je me disais, il n'y aurait pas moyen de récupérer le bazar en xml ?
parceque a première vue c'est les appel d'api version 32 dans un environement 64 qui posent soucis
A mon avis du long et de l'integer tu vas dans le mur sur la plateforme 64, utiliser l'alignement sur 8 avec Double
Pour l'api c il y a un petit chapitre la dessus: http://www-12.lotus.com/ldd/doc/domi...c?OpenDocument
Merci, mais je crois que je vais laisser tomber cette voie, je risque de faire planter tous les serveurs de prods...
tu ne connaitrais pas un autre moyen de récupérer les historiques de réplication ?
Demande à l'admin d'activer la journalisation des activités en choisissant d'activer l'option Domino.REPLICA, ensuite dans la base par ID réplique tu as les infos, octets écrits/octets lus
Sinon dans la base log.nsf, (usage -> par base) ou autre
Mais comme je ne sais pas ce que tu veux avoir comme info.....
Bon après quelques plantages serveurs
le problème ne vient pas de l'API-C Notes mais des appel aux API system genre : Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
au mieux ça récupère n'importe quoi au pire ça plante le serveur.
selon google le moyen de rendre l'appel compatible en VB7 est d'utiliser "PtrSafe" dans la déclaration : Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
mais biensur c'est pas reconnu en lotusscript une idée de comment utiliser ce bazar ?
Merci
Je ne pense pas que copymemory soit utilisé dans les exemples avec l'api C de Domino, prends plutôt memcpy.
j'ai le même effet...
pour ceux qui parlent allemand (ou qui ont google translate) => https://atnotes.de/index.php?topic=6...7877;topicseen
le probleme viendrait de oslockobjet
regarde xOSlockObject (LS2CAPI)
http://www.ls2capi.com/web/ls2capi/l...2?OpenDocument
Sinon je te fais le code, mais pas avant juillet, suis un peu débordé ;-)
En pj
Merci Jérome
j'avais trouvé le fichier sur le forum russe => https://codeby.net/threads/portirova...d-win64.62514/
maintenant je plante plus le serveur, je progresse. par contre la récupération des infos en mémoire c'est du grand n'importe quoi. a premiere vue en VB7 il faut rajouter ptrsafe a la déclaration pour qua ça functionne, mais en Ls ya pas... je vais bien finir par y arriver
un exemple de ce que je récupère en 64bit
12/07/3182 **:**:** PM;-1;;;
07/03/2019 06:45:33 AM;2;Receive;;‡
04/09/**** 02:00:00 AM;-1;;;
;-1;;;
;-1;;;
;-1;;;
;-1;;;
;0;Never;;
l'utilisation de memcpy ne change rien au probleme même résultat, je me fait insulter en martien
IBM a ouvert un SPR, mais en gros le niveau de priorité est négatif...
Maintenant c’est HCL :-) ça bouge plus
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager