Daily SQL Server Monitoring to ensure readiness and prevent disruptions
The internal SQL Server HTML Dashboard is a self-contained monitoring solution purpose-built to provide direct, real-time insights into SQL Server infrastructure. Developed with PowerShell automation and stored procedure orchestration, it functions independently from external observability tools like Splunk, ensuring continuous telemetry access even in the event of third-party outages.
This tool empowers technical teams to perform proactive system maintenance, validate audit readiness, and monitor SQL Server health, performance, and availability, all without relying on external integrations. The dashboard seamlessly connects to multiple SQL Server instances, executes targeted diagnostic queries, and renders structured visual and tabular data via a clean HTML interface.
The engine behind the dashboard consists of:
- A PowerShell scripts framework that dynamically enables monitoring modules based on configuration flags
- Custom stored procedures on each SQL Server instance for granular data collection
- Visualization components for memory and disk metrics (e.g. pie charts, column graphs)
- A robust function map where each function corresponds to specific operational indicators
Each function includes:
- A boolean config flag to toggle functionality
- A clearly defined SQL stored procedure for execution
- Structured output columns, complete with context-aware descriptions to aid interpretation
Adding Context with "Type Description" & "Why Monitor"
These two columns elevate the dashboard from being a technical tool to a decision support system. The DBAs, Sysadmins, or even Auditors have a clear reason for why a metric is important and what type of resource it targets.
Key Capabilities:
- Version and Service Status - Track OS and SQL Server versions and verify service
- Disk Usage Monitoring - Visual and tabular reports on disk consumption and available space
- CPU & Memory Consumption - View system-level and per-database resource usage to catch performance bottlenecks
- Live Query Diagnostics - Observe current sessions, long-running queries and blocking scenarios in real time
- Backup Integrity Checks - Confirm latest backup status for system and user databases, supporting DR validation
- Error Log Aggregation - Capture recent SQL Server errors for troubleshooting and trend analysis
- Agent Job & Alert Status - Monitor SQL Agent jobs and configured alerts to ensure scheduling health
- SQL Injection Detection - Scan query logs for patterns indicative of injection-based attacks
Functions:
- Get-SQLServerMemorySRVUsage - Monitors memory allocation for SQL Server services.
- Get-SQLServerMemoryDBUsage - Tracks memory consumption for each individual database.
- Get-SQLServerDiskIO - Reports I/O activity and latency for SQL Server database files.
- Get-SQLServerTransactionLog - Monitors transaction log size and usage across databases.
- Get-SQLServerSQLInjection - Detects potentially malicious SQL activity that resembles injection attacks.
- Get-SQLServerErrorLog - Extracts important messages from SQL Server’s error logs for diagnostics.
- Get-SQLServerBackupSystemDB - Audits system DB backups for recovery assurance.
- Get-SQLServerBackupUserDB - Logs backup metadata for user databases, optionally from EMC systems.
- Get-SQLServerStatusJobs - Tracks agent job execution status and logs for automation health.
- Get-SQLServerStatusAlerts - Audits alerts triggered on the SQL Server instance for incident monitoring.
- Get-SQLServerClusterStatus - Visualizes cluster node health and role assignment.
- Get-SQLServerAOAGStatus - Displays health and roles of availability group replicas.
- Get-SQLServerFailoverEvents - Records high-availability failover events across availability group replicas.
- Get-SQLServerCurrentConnections - Lists all active SQL Server client sessions for connection monitoring.
- Get-SQLServerCurrentQueries - Displays currently executing queries including session, login, and blocking info.
- Get-SQLServerCurrentBlocking - Identifies blocking sessions, lock types, and waits in progress.
- Get-SQLServerSysadminAccount - Audits SQL Server sysadmin role membership for security validation.
- Get-SQLServerTempDBUsage - Monitors TempDB usage to detect excessive temp table or version store activity.
- Get-SQLServerDatabaseGrowth - Tracks historical growth trends of databases for capacity planning.
- Get-SQLServerDatabaseHugeTables - Identifies large tables that may impact performance or storage.
Output:
C:\Temp\HTMLReports\SQLServer-main.ps1
Getting SQL Server Version Info ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Version Info ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Service Status ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Disk Space ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server CPU Usage ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Memory Server Usage ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Memory Database Usage ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Disk IO ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Transaction Log ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT |
Getting SQL Server Injection ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Error Log ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Backup System DB ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Backup User DB ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Jobs Status ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Alerts Status ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Cluster Status ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server AOAG Status ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT |
Getting SQL Server Failover Events ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Current Connections ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Current Queries ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Current Blocking ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Sysadmin Account ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server TempDB Usage ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Database Growth ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT Getting SQL Server Database Huge Tables ...Querying SERVER1\INSTANCE,PORT ...Querying SERVER2\INSTANCE,PORT ...Creating PDF |