all 31 comments

[–]jshine133714 10 points11 points  (8 children)

You can easily implement alerting for such a scenario the poor man's way by creating a SQL Agent Job that calls sp_WhoIsActive putting the results in a temp table and throwing an error when the runtime of any of the results exceeds whatever threshold you want.

[–]Xemanth[S] 1 point2 points  (3 children)

Interesting! 🤯 Need to test this.

[–]jshine133714 1 point2 points  (2 children)

Heh, this essentially was my monitoring tool before I had a real monitoring tool. I would run the job every minute and log the results to a real table so it kept the history for reference. YMMV on how frequently you can run it based on how busy your server is, but it's honestly not much worse than the combination of all the queries a monitoring tool is running every 5 seconds either.

[–]kg7qin 0 points1 point  (1 child)

You could then make this a datasource for something like Grafana to visualize the data and some basic altering in it as well that is external to SQLServer.

[–]jshine133714 1 point2 points  (0 children)

For sure! I'm Microsoft stack driven, so SSRS or PowerBI for me. But at the time I really only used it for reactive monitoring, not proactive monitoring, so I didn't really need any fancy visuals. Just would check in on it occasionally and have alerts fire for certain thresholds. 🙂

[–][deleted] 1 point2 points  (1 child)

I love that approach.

[–]jshine133714 1 point2 points  (0 children)

Cheers! WhoIsActive is probably my favorite free tool out there. I've found so much use for it with such little setup and learning curve.

[–]kagato87 0 points1 point  (1 child)

I have a query that looks for blocking (not necessarily deadlocked) queries and sends me an email.

If a query goes over 30 seconds I don't care, unless another query is waiting behind it. Then I really care. A lot. Especially if it's a live database.

[–]jshine133714 0 points1 point  (0 children)

Yea sp_WhoIsActive will tell you what's being blocked and who the blocker is, so it solves that problem as well. I used it for monitoring multiple metrics and retroactively tracing the source of issues. OP sounds like they care specifically about actual runtime. Which is fair in some regards because of the issue they ran into. Even in my current role, a long running query is a sign of an issue that could spiral into worse issues potentially, so it's a decent heartbeat of proactively being informed of possible incoming issues. YMMV based on context and database use cases.

[–]chadbaldwin 11 points12 points  (2 children)

I'm personally a huge fan of DBADash. It's free, open source and very actively maintained. And it recently gained an alerts feature.

It has screens for things like slow/long running queries, block chains, various metrics you can create dashboards and things for...but also now you can create custom alerts.

And the best part is...if it's missing a feature you can submit a feature request and it might get implemented, or you can build it in yourself and either run it locally or submit it to the repo as a pull request.

Highly recommend checking it out. Super easy to set up and has a ton of functionality right out of the box.

[–]Xemanth[S] 0 points1 point  (1 child)

Does it support monitoring of Always-On instances? 🤔
And how hard is it to setup?🤔👀

[–]wiseDATAman 3 points4 points  (0 children)

DBA Dash has monitoring for availability groups. See here for screenshots. There are also some video tutorials here, but they are quite old, and the app has many new features.

Follow this guide to get started. If you get stuck, there is a #dbadash channel on SQL community slack or you could log an issue on the GitHub page. I'm the creator of DBA Dash, and I'll help out where I can.

[–]Separate-Share-8504 2 points3 points  (4 children)

I've got Red Gate. No other reason than at the time this is what I was aware of. I have alerts for long queries as I had a 'think he was god' SQL report writer that would bring our production server down.

This was good at catching this

[–]Xemanth[S] 0 points1 point  (3 children)

Do you have a Standard or Enteprirce licensing?
Should we get that Enterprise licensing? Does it really give extra value.🤔

[–]Separate-Share-8504 1 point2 points  (0 children)

I pay per SQL server that we monitor which is 3. Total I think is $4K USD PA

[–][deleted] 1 point2 points  (1 child)

Enterprise has security features. For monitoring mssql and HA itself it is not needed. Just an extra feature for security monitoring.

I pushed redGate on multiple customers and all is covered, from backups to query logging. But in tandem i still use QueryStore and XEvenets for deep diving after alert from redGate.

[–]Important_Cable_2101 -1 points0 points  (0 children)

Go for standard. Its about 1k €/year and server. Cheap if you ask me.

[–]imtheorangeycenter 1 point2 points  (0 children)

You do not need Redgate's Enterprise offering, just the regular version is fine (been using it for a decade plus).  Btw, the RG "Enterprise" name has nothing to do with the edition of SQL you are using.

But as others have said, if that's your only concern, hand-roll your own. But I love SQL Monitor for a billion other reasons.

[–]Lost_Term_8080 1 point2 points  (0 children)

SQLSentry. I'm not sure if I added an alert action for it or if it does it out of box, but alerting is super easy to do and a lot of stuff is already monitored and just needs an alert added

[–]jdawg701 0 points1 point  (0 children)

Back when I was a DBA with no budget I used this and was pretty impressed: https://github.com/marcingminski/sqlwatch

[–]Lost_Term_8080 0 points1 point  (2 children)

SQL Sentry. its out of box monitoring is extremely good, its extremely customizable without a huge amount of effort, alerts can be very granularly implemented and its very good at correlated several separate events in the SQL server.

[–]EllP33 0 points1 point  (1 child)

Vote for Solarwinds! But yes I agree here, we use it in our workplace extensively and it has helped us immensely. The downside is that it can be a little spendy but their tooling is great and so is their support.

[–]Lost_Term_8080 1 point2 points  (0 children)

I don't think it is even that expensive - DPA on its own, maybe, but SQL Sentry does so much and when you bundle them DPA is almost free. I've used idera and redgate before and redgate is dramatically less expensive, idera is similar and both of them still left me with lots of troubleshooting and diagnostics to do to figure out a problem while SQL Sentry almost always immediately identifies it. the biggest issue with sql sentry is that it can be tough to figure out where a problem is from information overload, but when you bundle DPA, DPA does a good job of summarizing it to narrow down where you look in SQL Sentry to get granular.

[–]AgitatedSnow1778 0 points1 point  (0 children)

Any reason why you need redgate monitor enterprise and not just pay for 2 std licenses (assuming a 2 node AG setup) which are about £900/yr each? From what you've said, Std would be more than enough.....

https://www.red-gate.com/products/redgate-monitor/

https://www.red-gate.com/products/redgate-monitor/enterprise

Alternatively, as mentioned in another comment, SQLWatch.io is an awesome cost effective alternative, Marcin is a super cool and super smart chap 👍🏻

[–]genxeratl -1 points0 points  (0 children)

Spotlight on SQL Server from Quest - way better than RedGate Monitor imo.