This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

monitoring for the sql shrink flag

Calling all SQL experts.  Is anyone aware of a way to monitor for the SQL shrink flag?

  • SCOM does it. You could do it with SAM with a custom POSH monitor - check the new SQL POSH modules, they're incredible.

    SCOM's config -

    - <Configuration>

    <ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>

    <DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>

    <IntervalSeconds>43200</IntervalSeconds>

    <SyncTime />

    <ConfigValue>AutoShrink</ConfigValue>

    <ExpectedValue>OFF</ExpectedValue>

    <ExcludeOnExpress>false</ExcludeOnExpress>

    <SQLSKU>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Edition$</SQLSKU>

    <TimeoutSeconds>300</TimeoutSeconds>

    </Configuration>

  • Interesting; so is POSH something that has to be installed or is just a moniker for Powershell ran against SQL?   Which then I guess would just be a PowerShell monitor in SAM?

    Makes you wonder if this is what all the "custom performance monitors" are in the AppInsight for SQL template...

  • It's just the powershell monitor that is included in SAM. You can script it.  Just have to have a user account that SAM can use to run the Powershell script locally or remotely against the host machine. 

  • The Performance monitors are just WMI calls.