Monitor the output of a sql query in Azure Monitor

Michael Kleinpaste 26 Reputation points
2021-03-20T00:00:48.07+00:00

In Nagios, we have the ability to query a table in MSSQL server and then generate a warning and an alert based off the "Expected result". We currently use this to track if we're backing up a process that's logged in a table. We're looking to move to Azure Monitor but I'm not finding any documentation on creating an alert from this kind of source. Am I just not looking in the right spot or is this not a function in Azure Monitor?

--query "select top(1) value from TrackingTable where logtype = 2 order by logdate desc"
--result "Expected result"
--warning 50
--critical 200
--querycritical 1
--result Expected result

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,815 questions
{count} vote

Accepted answer
  1. bharathn-msft 5,086 Reputation points Microsoft Employee
    2021-03-31T02:04:10.653+00:00

    <<Converting the comments to answer for the broader community usage.>>

    @Michael Kleinpaste - Apologies for the delay in getting back to this thread, post reviewing this with our internal team it has been called out that there's nothing out of the box. That said, we see customers going towards "custom code" route. Also with Logic Apps, it should be quite simple: there are both "query SQL" and "Send to Log Analytics" activities.

    Once you send the data to Log Analytics, you can alert as required.

    Hope this information helps , please feel free to circle back if you have any further queries. Thank you.


0 additional answers

Sort by: Most helpful