Im using this metric (deployed by a template attached to all Windows systems):
Then you can use something like this in automatic bind/auto apply:
Code Select
ExternalMetric = MSSQL.InstalledInstancesCount:powershell -NonInteractive -NoProfile -Command "& { (Get-ItemProperty \"HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\").InstalledInstances.Count }"
Then you can use something like this in automatic bind/auto apply:
Code Select
value = $node.readAgentParameter("MSSQL.InstalledInstancesCount");
return (value != NULL && typeof(value) == "int32" && value > 0);