racker/virgo — pull request #422 by rjemanuele (2013-07-01 18:57:16+00:00)
Title: SQL Database Check and Tests

* Includes the use of a test config file specified by an env var
* Pulls data from a local or remote sql server with specified credentials
* Requires initializing the Powershell (x86) to include the SQL snapin, see below

$sqlpsPath="C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\"
$framework=$([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())
Set-Alias installutil "$($framework)installutil.exe"
installutil "$($sqlpsPath)Microsoft.SqlServer.Management.PSSnapins.dll"
installutil "$($sqlpsPath)Microsoft.SqlServer.Management.PSProvider.dll"

* Refactor Windows checks utilitzing the Powershell into something extensible.
* Create multiple test_sqlserver_checks based on an external config file to specify the server to test against
* Add checks for the SQL Server Buffer Manager and SQL Statistics taken from the system counters.
* Add Counters for the SQL Server: Buffer Manager, Plan Cache, SQL Statistics, and Memory Manager
* Refactor the Windows checks to be a even more flexible.
* All powershell CSV output columns can now be custom handled by each check
* SQL Server Tests use a config file for their parameters or skip the tests
* Checks can convert CSV entries to metrics using an inherited function
* Add escaping of params passed to powershell and sql server
* Printing of failure errors from tests
* Powershell command error handling, gets the first string returned from a powershell error
* Error out the Invoke-SqlCmd if it doesn't exist. Fix the console width for Powershell 2.0.
* Add fixtures for MS SQL tests so they can be tested against live servers or fixtures