New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config values for SQLAgent failed job status and date #552

NickGuy1 opened this Issue Sep 19, 2018 · 0 comments


None yet
1 participant
Copy link

NickGuy1 commented Sep 19, 2018

Feature Request

within the failed job check it would be good to be able to exclude particular types of lastrunstatus (e.g. cancelled) and also limit this to only jobs which have lastrundate in the last X days

What should be configurable for the results of the check ?

The date to check for the last run date

What should be able to be excluded from being tested ?

Exclude JobStatus

Additional information

I've been using the below in a variation of the existing check to achieve this

$ExcludeStatus = "Cancelled"
$JobDaysHistory = 3
$Jobstartdate =(get-date).AddDays(-$JobDaysHistory)

and then changing

@(Get-DbaAgentJob -SqlInstance $psitem | Where-Object {$.IsEnabled -and ($ExcludeStatus -notcontains $.LastRunOutcome) -and $_.lastrundate -igt $Jobstartdate}).ForEach{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment