How can we help you today? How can we help you today?

SQL Monitor Custom Metrics Powershell

I want to be able to create custom metrics using powershell API is this possible.

 

as an example collect count of rows in various app specific error tables in a user database and alert. I have 100 alerts to configure of this nature is it possible to automate.

Greg White
2

Comments

2 comments

  • Tom Claringbold
    Official comment

    Hi Greg,

    It isn't currently possible to create custom metrics with the PowerShell API. These will need to be created in the UI.

    I would suggest raising this request on the UserVoice site, votes on these suggestions can help prioritise future features!

    Apologies I'm unable to offer you a solution with current functionality.

    Tom Claringbold
  • alexiaamber

    As far as I know, you can automate a lot of the configuration with PowerShell and the SQL Monitor API, but the custom metric itself still needs to be something SQL Monitor supports collecting. For your example, another approach is to create a custom metric that runs a query like SELECT COUNT(*) against each error table, then use the API/PowerShell to deploy the same metric and alert configuration across all of your monitored servers or databases instead of creating 100 alerts manually. I've done similar bulk configuration through the API, and it saved a lot of repetitive work. If all of your wheelie life tables follow the same pattern, scripting the creation of the metrics and alert settings is definitely the way I'd go rather than configuring each one individually.

    alexiaamber
    -1

Add comment

Please sign in to leave a comment.