SQLUndercover / UndercoverToolbox

A collection of cool and useful tools, procedures and scripts for the discerning DBA
https://sqlundercover.com
MIT License
84 stars 40 forks source link

Inspector - missing ServerInfo causes blank Inspector Report #302

Open markwdavies opened 2 years ago

markwdavies commented 2 years ago

Issue Empty Email body for Inspector reports run on a central server using PoSH

Cause Stored Proc - [Inspector].[SQLUnderCoverInspectorReport] does not check if null returned when retrieving monitored server Information - this value is concatenated with the rest of the email body text rendering it all null.

Function - [Inspector].[GetServerInfo] returns null If a row is not found in the [Inspector].[ServerInfo] table for a monitored server

To Reproduce remove one of the rows in the table for a monitored server and run the Stored Proc to generate an email

workaround Amend Line 360 in [Inspector].[SQLUnderCoverInspectorReport] from +[Inspector].[GetServerInfo](@Serverlist) to +ISNULL([Inspector].[GetServerInfo](@Serverlist),'--- no data ---')

Adedba commented 2 years ago

Thanks for reporting, apologies for not responding sooner. Will get this updated and rolled out as a hot fix.