Server Availability

  • Just want to know of a script I could maybe write that will email me or page out when the server is down.

    Any replies will be appreciated.

    Thanks

  • Where is this script going to be running when the server is down?

  • You looking to track the server or the SQL Server itself? Also, what sort of agents/tools do you have in your environment?

    K. Brian Kelley
    @kbriankelley

  • Just something to maybe email me or even page out when the SQL Agent or the SQL Server goes down. Notification Services has been uninstalled so can't use that... Does Windows have anything set up that could alert when the service stops?

  • There isn't very much that runs when, for example, the server loses power.

    You really need a monitoring tool running on another server. You might check into HP OpenView or MS MOM if you don't feel like developing your own.

  • Sorry I should have been more specific... The SQL Server iS 2005 running on a Windows Server (v 2003). The scenario I am looking for is when the SQL server goes down for whatever reason I would like an email stating it is down. The Windows server is still up and running, its just the SQL Server I am concerned about...

  • Out of the box? No. You'll either need to go with a monitoring tool capable of connecting with SQL Server, looking at the state of services on the server, or write a script that does so.

    K. Brian Kelley
    @kbriankelley

  • Hi,

    Ideally, you should use a monitoring tools such as MOM or ping utility.

    Thanks,

    Phillip Cox

  • Jamie, the point is that any agent job you attempt to create that will notify you that agent is down or going down will never fire since, well Agent is down or going down.

    You could have a job that will run when Agent starts that tells you that the SQL instance WENT down though. 🙂

    Ideally you'll need to approach this as the others have suggested, with Openview, MOM or another monitoring suite. You can set alerts for service failure and that is precisely what you're looking for by the sound of things.

    - Tim Ford, SQL Server MVPhttp://www.sqlcruise.comhttp://www.thesqlagentman.com http://www.linkedin.com/in/timothyford

  • At my previous employer we used an ELM tool from tntsoftware.com It allowed us to monitor the event logs and send emails for various items. The drawback was, initially, we had to constantly add filters so we weren't emailed everything (success, failures, warnings). It took a month or so until we got to where only pertinent messages were coming out, i.e SQL Server failues, SQL job failures, infrastructure applicable message, etc. If I'm not mistaken, it's a per server license, resides on one application server, it continually monitors all licensed servers and can send emails to users/groups based on the filters. Again, from a maintenance standpoint, once we got past the point of applying our filters, it was pretty much good-to-go. Nice tool which helped us all sleep a little better at night.

    -- You can't be late until you show up.

  • Open the Windows Service Control applet and navigate to the SQL Server service. Look at the Recovery tab, and you see you can specify a script to run if the service fails. You have to write this script yourself, so it can include sending a mail before restarting SQL Server.

    Although this could work, it is not very scalable if you have a lot of servers to manage. The best advice has already been given - invest in monitoring tools such as MOSS, Patrol, NetIQ, OpenView, etc, etc.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply