Skip to content

Commit

Permalink
health-check: fixed minor bugs on data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
rentadba committed Feb 20, 2022
1 parent 0aaacef commit 282f739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ WHILE @@FETCH_STATUS=0
FROM [health-check].[statsErrorlogDetails] eld
WHERE eld.[project_id] = @projectID
AND eld.[instance_id] = @instanceID

SET @lastCollectedEventTime = ISNULL(@lastCollectedEventTime, '2021-01-01')

-------------------------------------------------------------------------------------------------------------------------
/* get local time to UTC offset */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ WHILE @@FETCH_STATUS=0
#-- Create date : 20.11.2014
#-- Module : Database Analysis & Performance health-check
#-- Description : read OS event logs: Application, System, Setup
#-- ============================================================================
#-- ============================================================================
$timeoutSeconds = ' + CAST(@configEventsTimeOutSeconds AS [nvarchar]) + N'
$code = {
$ErrorActionPreference = "SilentlyContinue"
Expand Down Expand Up @@ -393,7 +392,7 @@ WHILE @@FETCH_STATUS=0
SET @strMessage=N'running powershell script - get OS events...'
EXEC [dbo].[usp_logPrintMessage] @customMessage = @strMessage, @raiseErrorAsPrint = 1, @messagRootLevel = 0, @messageTreelevel = 4, @stopExecution=0

SET @queryToRun='master.dbo.xp_cmdshell N''@PowerShell -File "' + [dbo].[ufn_getObjectQuoteName](@psFileLocation + @psFileName, 'sql') + '"'''
SET @queryToRun='master.dbo.xp_cmdshell N''@PowerShell -ExecutionPolicy Bypass -File "' + [dbo].[ufn_getObjectQuoteName](@psFileLocation + @psFileName, 'sql') + '"'''
IF @debugMode=1 EXEC [dbo].[usp_logPrintMessage] @customMessage = @queryToRun, @raiseErrorAsPrint = 0, @messagRootLevel = 0, @messageTreelevel = 4, @stopExecution=0

DELETE FROM #psOutput
Expand Down

0 comments on commit 282f739

Please sign in to comment.