Commit 891a3e20701f68acd5789e6fefb2bdbe292fba32
1 parent
02a9fd6e
Exists in
master
-Recepção para força coleta.
-Gravando a chave durante o getTeste e verificando se é uma coleta forçada ao término do envio.
Showing
3 changed files
with
18 additions
and
14 deletions
Show diff stats
MapaTesteProj/MapaCACIC.identcache
No preview for this file type
gercols/gercols.dpr
... | ... | @@ -243,15 +243,15 @@ Begin |
243 | 243 | Begin |
244 | 244 | objCacic.setBoolCipher(not objCacic.isInDebugMode); |
245 | 245 | objCacic.setValueToFile('Configs','ConexaoOK','S', strGerColsInfFileName); |
246 | - objCacic.setValueToFile('Configs','forca_coleta', | |
247 | - objCacic.getValueFromTags('forca_coleta', strRetorno), | |
248 | - strGerColsInfFileName); | |
249 | 246 | if (objCacic.getValueFromTags('WebManagerAddress', strRetorno,'<>') <> '') then |
250 | 247 | Begin |
251 | - objCacic.setValueToFile('Configs','WebManagerAddress' ,objCacic.getValueFromTags('WebManagerAddress' , strRetorno,'<>'), strChkSisInfFileName); | |
252 | - objCacic.setValueToFile('Configs','WebServicesFolderName',objCacic.getValueFromTags('WebServicesFolderName', strRetorno,'<>'), strChkSisInfFileName); | |
253 | - objCacic.setWebManagerAddress(objCacic.getValueFromTags('WebManagerAddress', strRetorno,'<>')); | |
254 | - objCacic.setWebServicesFolderName(objCacic.getValueFromTags('WebServicesFolderName', strRetorno,'<>')); | |
248 | + objCacic.setValueToFile('Configs','forca_coleta', | |
249 | + objCacic.getValueFromTags('forca_coleta', strRetorno), | |
250 | + strGerColsInfFileName); | |
251 | + objCacic.setValueToFile('Configs','WebManagerAddress' ,objCacic.getValueFromTags('WebManagerAddress' , strRetorno,'<>'), strChkSisInfFileName); | |
252 | + objCacic.setValueToFile('Configs','WebServicesFolderName',objCacic.getValueFromTags('WebServicesFolderName', strRetorno,'<>'), strChkSisInfFileName); | |
253 | + objCacic.setWebManagerAddress(objCacic.getValueFromTags('WebManagerAddress', strRetorno,'<>')); | |
254 | + objCacic.setWebServicesFolderName(objCacic.getValueFromTags('WebServicesFolderName', strRetorno,'<>')); | |
255 | 255 | End; |
256 | 256 | |
257 | 257 | strAcaoGerCols := 'IP validado pelo Módulo Gerente WEB ('+objCacic.getWebManagerAddress+').'; |
... | ... | @@ -989,16 +989,16 @@ Begin |
989 | 989 | |
990 | 990 | // Coletas de todos os atributos de hardware |
991 | 991 | tstrColetaHardware := fetchWmiValues('Win32_Keyboard', objCacic.getLocalFolderName, 'Availability,Caption,Description,InstallDate,Name'); |
992 | -// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_Keyboard=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
993 | - strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Teclado=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
992 | + strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_Keyboard=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
993 | +// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Teclado=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
994 | 994 | |
995 | 995 | tstrColetaHardware := fetchWmiValues('Win32_PointingDevice', objCacic.getLocalFolderName, 'Availability,Caption,Description,InstallDate,Manufacturer,Name'); |
996 | -// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_PointingDevice=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
997 | - strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Mouse=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
996 | + strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_PointingDevice=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
997 | +// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Mouse=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
998 | 998 | |
999 | 999 | tstrColetaHardware := fetchWmiValues('Win32_PhysicalMedia ', objCacic.getLocalFolderName, 'Caption,Description,InstallDate,Name,Manufacturer,Model,SKU,SerialNumber,Tag,Version,PartNumber,OtherIdentifyingInfo,Capacity,MediaType,MediaDescription'); |
1000 | -// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_PhysicalMedia=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
1001 | - strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Mídia Física=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
1000 | + strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_PhysicalMedia=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
1001 | +// strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Mídia Física=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); | |
1002 | 1002 | |
1003 | 1003 | tstrColetaHardware := fetchWmiValues('Win32_BaseBoard', objCacic.getLocalFolderName, 'Caption,ConfigOptions,Depth,Description,Height,HostingBoard,InstallDate,Manufacturer,Model,Name,OtherIdentifyingInfo,PartNumber,Product,RequirementsDescription,SerialNumber,SKU,SlotLayout,SpecialRequirements,Tag,Version,Weight,Width'); |
1004 | 1004 | strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',Win32_BaseBoard=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(objCacic.replaceInvalidHTTPChars(tstrColetaHardware))); |
... | ... | @@ -1580,8 +1580,10 @@ Begin |
1580 | 1580 | objCacic.writeDebugLog('executeGerCols: Coleta Forçada? -> ' + objCacic.getValueFromTags('DT_HR_COLETA_FORCADA',strActionDefinition)); |
1581 | 1581 | // Se essas informações forem diferentes significa que houve alguma alteração na configuração. Nesse caso, gravo as informações no BD Central e, |
1582 | 1582 | // se não houver problemas durante esse procedimento, atualizo o registro local. |
1583 | + // Se for uma coleta forçada, também grava as informações. | |
1583 | 1584 | If (objCacic.enCrypt(strColetaAtual) <> strColetaAnterior) or |
1584 | - (strColetaAnterior = '') Then | |
1585 | + (strColetaAnterior = '') or | |
1586 | + (objCacic.getValueFromFile('Configs', 'forca_coleta') = 's') Then | |
1585 | 1587 | Begin |
1586 | 1588 | strAcaoGercols := 'Enviando coleta de informações sobre ' + objCacic.getValueFromTags('te_descricao_breve',strActionDefinition) + ' para o Gerente WEB ('+objCacic.getWebManagerAddress+').'; |
1587 | 1589 | objCacic.writeDailyLog(strAcaoGercols); | ... | ... |
main.pas
... | ... | @@ -1319,6 +1319,8 @@ begin |
1319 | 1319 | |
1320 | 1320 | objCACIC.writeDebugLog('ExecutaCACIC: Primeira chamada ao Gerente de Coletas...'); |
1321 | 1321 | Invoca_GerCols('getConfigs'); |
1322 | + if (objCACIC.getValueFromFile('Configs', 'forca_coleta', strGercolsInfFileName) = 's') then | |
1323 | + Invoca_GerCols('collect'); | |
1322 | 1324 | sleep(3000); // Pausa para início do Gerente de Coletas e criação do arquivo temp\aguarde_GER.txt |
1323 | 1325 | |
1324 | 1326 | Application.ProcessMessages; | ... | ... |