Status: Reviewed (deep-dive v1)
Stack: PowerShell census → SQL history warehouse/procs → Blazor Server UI
Depends on: SQL-01 Inventory (instance list); watches jobs from SQL-02/03 (backups, index maint)
Goal: Know which jobs matter, when they fail or run long, and that nothing critical is missing or overlapping.
Backups and index work only help if their Agent jobs actually run. Job failure and silent disable are common outage causes. Monitor the babysitters.
| Tag | Examples | Alert bias |
|---|---|---|
| Critical | Full/log backup, AG backups, CHECKDB (prod), payroll ETL | Page / immediate |
| High | Index maint execute, stats, diff backup | Same-day |
| Standard | Housekeeping, cycle error log | Daily digest |
| Ignore | Ad-hoc, disabled leftovers (documented) | Hide from main board |
Maintain a JobCatalog override table so rename/category quirks don’t drop critical coverage.
Scope = inventoried instances where Agent should run.
SQLSERVERAGENT / named SQLAgent$*)msdb schedule tables)msdb.dbo.sysjobhistory (outcome, run_duration, message) — last N dayssysjobactivity / sp_help_jobactivityCollectedAtRead-only collect. Don’t start/stop jobs from the collector.
| Table | Purpose |
|---|---|
dbo.SqlAgentJob |
Job identity + enabled + category + criticality tag |
dbo.SqlAgentSchedule |
Schedule facts per job |
dbo.SqlAgentJobHistory |
Trimmed history (retain 30–90 days) |
dbo.SqlAgentJobBaseline |
Duration baseline per job |
dbo.SqlAgentJobStatus |
Latest outcome, last success, running flag, overdue schedule |
Procs:
usp_SqlAgentJob_Upsert — merge job + schedulesusp_SqlAgentHistory_Apply — load history; update status + baselinesusp_SqlAgent_GetFailBoard — Blazor failed/long/disabled-criticalusp_SqlAgent_GetJobDetail — history sparkline + last messagesusp_SqlAgent_GetMissingCritical — expected tags with no matching jobLong-running rule (start): running longer than max(2× baseline, baseline + 30 min) → Yellow/Red.
Overdue rule: enabled critical job with schedule and LastSuccess older than schedule interval × 2.
| Symptom | Likely cause |
|---|---|
| All jobs failing | Agent stopped; msdb issue; credentials |
| One step fails | Proxy/subsystem; path; linked server |
| Succeeds but overdue later | Schedule disabled; daylight change; AG failover job ownership |
| Duration creep | Data growth; competing maint; blocking |
| No history | Job never ran; Agent history retention too aggressive; wrong instance |
IndexMaintPolicy / runbookmsdb job tables; PS service querySecurity & access hygiene — who can change these jobs and what logins exist.
SQL Dude — SQL-04 SQL Agent Jobs & Schedules v1