How can we setup alert when sqlservver instance went down or services not started?


Todas las respuestas

  • Hi Ron,

    Once the SQL Server instance is stopped or paused, you cannot make use of any features within this instance, such as notification service to alert the status.
    In this case, you may consider Powershell to monitor SQL Server service. Please see: Monitoring SQL Server Service with WMI Events and ShowUI. In addition, you send the email with output via powershell. Here is an example: Sending email using Powershell script.

    Stephanie Lv

    TechNet Community Support

    • Marcado como respuesta Stephanie Lv lunes, 02 de abril de 2012 8:26
    lunes, 26 de marzo de 2012 4:30
  • How can we do this on a specific event ?

    Suppose if i want to fire an email only if a service is down or stopped.

    Rgds, Minesh

    martes, 26 de junio de 2012 12:00
  • I have several examples to use Powershell  WMI/WMI for Server Events and on Simple-Talk

    But you can easily use it in SQL WMI Alerts too.

    An example to SQL Server Stops

    SQL WMI Alert

    Runspace '\\.\root\CIMV2'

    NAmed Instance INST1

    WQL = "select * from __InstanceModificationEvent within 5 where TargetInstance ISA 'Win32_Service' and TargetInstance.Name='MSSQL$INST1' and TargetInstance.State='Stopped'"

    Default Instance

    WQL = "select * from __InstanceModificationEvent within 5 where TargetInstance ISA 'Win32_Service' and TargetInstance.Name='MSSQLSERVER' and TargetInstance.State='Stopped'"

    Then you can configure a operator or run a job to send the email


    $Query = "selec$Query = "select * from __InstanceModificationEvent within 5 where TargetInstance ISA 'Win32_Service' and TargetInstance.Name='MSSQL`$`INST1' and TargetInstance.State='Stopped'"
    Register-WMIEvent  -ComputerName "ObiWan" `
         -Query $query `
         -Action {  DoSomething

    You need any help, please ping me on


    lunes, 09 de julio de 2012 10:44