Enhancements to COC_AVAILABILITY to reduce false
positives and add additional logging.
This commit is contained in:
parent
0e51db912a
commit
dd3aaad4a6
@ -22,6 +22,7 @@ Function FTP_Services(@Service, @Params)
|
|||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/10/18 dmb Original programmer.
|
07/10/18 dmb Original programmer.
|
||||||
11/13/24 djm Add ListDirectory service.
|
11/13/24 djm Add ListDirectory service.
|
||||||
|
01/08/24 djm Changed ListDirectory to preserve host error message and set Error_Services.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
@ -822,7 +823,6 @@ Service ListDirectory(Host=HOSTS, Username, Password, RemoteDirectory, Query, Sc
|
|||||||
If (Host NE '') AND (RemoteDirectory NE '') then
|
If (Host NE '') AND (RemoteDirectory NE '') then
|
||||||
ScriptPath = FTP_Services('CreateScript', ScriptPath, Host, '', Username, Password, '', RemoteDirectory, Query, 'list', SSH)
|
ScriptPath = FTP_Services('CreateScript', ScriptPath, Host, '', Username, Password, '', RemoteDirectory, Query, 'list', SSH)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
//FTP_Services('RunScript', ScriptPath, Host, Username, Password, '', RemoteDirectory, DeleteScript, SSH)
|
|
||||||
If SSH EQ True$ then
|
If SSH EQ True$ then
|
||||||
Command = 'psftp'
|
Command = 'psftp'
|
||||||
If Username NE '' then
|
If Username NE '' then
|
||||||
@ -837,9 +837,12 @@ Service ListDirectory(Host=HOSTS, Username, Password, RemoteDirectory, Query, Sc
|
|||||||
end else
|
end else
|
||||||
Command = 'ftp -i -n -s:' : ScriptPath
|
Command = 'ftp -i -n -s:' : ScriptPath
|
||||||
end
|
end
|
||||||
//Command = 'psftp ' : ScriptPath
|
|
||||||
DirectoryList = SRP_Run_Command(Command, 'VAR')
|
DirectoryList = SRP_Run_Command(Command, 'VAR')
|
||||||
|
If Count(DirectoryList, 'ssh_init') EQ 0 then
|
||||||
Gosub LsToMls
|
Gosub LsToMls
|
||||||
|
end else
|
||||||
|
Error_Services('Add', DirectoryList)
|
||||||
|
end
|
||||||
Response = DirectoryList
|
Response = DirectoryList
|
||||||
If OutputPath NE '' then
|
If OutputPath NE '' then
|
||||||
OutputDirectoryList = DirectoryList
|
OutputDirectoryList = DirectoryList
|
||||||
@ -899,3 +902,4 @@ return
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ Compile function Shipment_Services(@Service, @Params)
|
|||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
11/13/24 djm Original programmer.
|
11/13/24 djm Original programmer.
|
||||||
|
1/8/2025 djm Added parsing for connection errors and logging for loop resets. Removed emails for COC_AVAILABILITY.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
@ -75,6 +76,7 @@ Service CycleRetentionDates()
|
|||||||
PotentialEndDate = CurrEndDate - 10
|
PotentialEndDate = CurrEndDate - 10
|
||||||
Begin Case
|
Begin Case
|
||||||
Case CurrStartDate EQ EarliestDate
|
Case CurrStartDate EQ EarliestDate
|
||||||
|
gosub LogLoopReset
|
||||||
StartDate = TodayDate - 10
|
StartDate = TodayDate - 10
|
||||||
EndDate = TodayDate
|
EndDate = TodayDate
|
||||||
Case PotentialStartDate LT EarliestDate
|
Case PotentialStartDate LT EarliestDate
|
||||||
@ -93,6 +95,7 @@ Service CycleRetentionDates()
|
|||||||
EndDate = Oconv(EndDate, 'D4-')
|
EndDate = Oconv(EndDate, 'D4-')
|
||||||
Shipment_Services('CheckFileAvailability', StartDate, EndDate)
|
Shipment_Services('CheckFileAvailability', StartDate, EndDate)
|
||||||
end else
|
end else
|
||||||
|
gosub LogLoopReset
|
||||||
StartDate = TodayDate - 10
|
StartDate = TodayDate - 10
|
||||||
EndDate = TodayDate
|
EndDate = TodayDate
|
||||||
NewRec = ''
|
NewRec = ''
|
||||||
@ -151,6 +154,7 @@ Service CheckFileAvailability(StartDate, EndDate)
|
|||||||
DeleteScript = True$
|
DeleteScript = True$
|
||||||
Query = '*' : COCNo : '*'
|
Query = '*' : COCNo : '*'
|
||||||
QueryResult = FTP_Services('ListDirectory', FTPHost, Username, Password, RemoteDirectory, Query, '', DeleteScript, SSH, '')
|
QueryResult = FTP_Services('ListDirectory', FTPHost, Username, Password, RemoteDirectory, Query, '', DeleteScript, SSH, '')
|
||||||
|
If Count(QueryResult, 'ssh_init') EQ 0 then
|
||||||
If QueryResult EQ '' then
|
If QueryResult EQ '' then
|
||||||
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
Error_Services('Add', 'Expected file for shipment ' : COCNo : ' missing.')
|
||||||
NewCOC<COC_FTP_EXISTS$> = False$
|
NewCOC<COC_FTP_EXISTS$> = False$
|
||||||
@ -160,6 +164,7 @@ Service CheckFileAvailability(StartDate, EndDate)
|
|||||||
end
|
end
|
||||||
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
Database_Services('WriteDataRow', 'COC', COCNo, NewCOC, True$, False$, False$)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
END
|
END
|
||||||
REPEAT
|
REPEAT
|
||||||
end
|
end
|
||||||
@ -219,18 +224,18 @@ Service SetMONACritical(MONAResource=MONAResources, ErrorMessage)
|
|||||||
|
|
||||||
IF MONAResource = 'FILE_GENERATION' OR MONAResource = 'FILE_TRANSMISSION' OR MONAResource = 'FILE_AVAILABILITY' then
|
IF MONAResource = 'FILE_GENERATION' OR MONAResource = 'FILE_TRANSMISSION' OR MONAResource = 'FILE_AVAILABILITY' then
|
||||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_COC', MONAResource, 'CRITICAL')
|
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_COC', MONAResource, 'CRITICAL')
|
||||||
If ErrorMessage NE '' then
|
* If ErrorMessage NE '' then
|
||||||
// Send an internal OI message to FI Support
|
* // Send an internal OI message to FI Support
|
||||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', 'USER_ID', 'X')
|
* Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', 'USER_ID', 'X')
|
||||||
SentFrom = 'SYSTEM'
|
* SentFrom = 'SYSTEM'
|
||||||
Subject = 'COC ' : MONAResource : ' Error!'
|
* Subject = 'COC ' : MONAResource : ' Error!'
|
||||||
Message = ErrorMessage
|
* Message = ErrorMessage
|
||||||
AttachWindow = ''
|
* AttachWindow = ''
|
||||||
AttachKey = ''
|
* AttachKey = ''
|
||||||
SendToGroup = ''
|
* SendToGroup = ''
|
||||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
* Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||||
obj_Notes('Create',Parms)
|
* obj_Notes('Create',Parms)
|
||||||
End
|
* End
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'Invalid COC MONA resource.')
|
Error_Services('Add', 'Invalid COC MONA resource.')
|
||||||
end
|
end
|
||||||
@ -277,10 +282,7 @@ End Service
|
|||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
|
||||||
// LogMissingFile
|
|
||||||
//
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
|
||||||
LogMissingFile:
|
LogMissingFile:
|
||||||
|
|
||||||
LogData = ''
|
LogData = ''
|
||||||
@ -292,6 +294,17 @@ LogMissingFile:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
LogLoopReset:
|
||||||
|
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = ''
|
||||||
|
LogData<3> = 'Loop Restart'
|
||||||
|
LogData<4> = ''
|
||||||
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
CompanyExceptionCheck:
|
CompanyExceptionCheck:
|
||||||
|
|
||||||
@ -326,3 +339,4 @@ CompanyExceptionCheck:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user