Get notified when sql server agent isn't running?

  • Basically I have jobs on a server, which I dont control or the hardware its on. I have jobs like backups running. If agent isnt running, the jobs dont run?

    How can i get notified that teh jobs dont run? I can get nofication of failure - but that require ewth agent to be running doesnt it?

    I have multiple instances in variuos sites to monitor like this?

    Any advice appreciated. Thanks

  • Adam Sandler (9/1/2016)


    Basically I have jobs on a server, which I dont control or the hardware its on. I have jobs like backups running. If agent isnt running, the jobs dont run?

    How can i get notified that teh jobs dont run? I can get nofication of failure - but that require ewth agent to be running doesnt it?

    I have multiple instances in variuos sites to monitor like this?

    Any advice appreciated. Thanks

    There's many ways to deal with this, the only limitation has to do with what you have rights to do. The SQL Agent runs as a Windows Service and there's simple DOS or Powershell commands you can run to check if that service is running. You could setup a script that runs remotely to check if it's running and fire off an Email alert if it's not.

    Obviously the SQL Agent itself cant alert you if it's not running but it can alert you if it is running and a job fails.

    Lastly, it's worth noting that the SQL Agent service does not crash often, I've been working with SQL for almost 18 years and almost never see the service stop working except for dumb reasons like the service is running under a user's account where the password changed or something like that.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • Thanks Alan - I suppose this is something I should get the local network / support people to set up for me?

    Any settings I can apply to make sure the agent is running if the sql server is running? I think I have is starting up automatically.

    Thanks again.

  • Adam Sandler (9/1/2016)


    Thanks Alan - I suppose this is something I should get the local network / support people to set up for me?

    Any settings I can apply to make sure the agent is running if the sql server is running? I think I have is starting up automatically.

    Thanks again.

    Having the services set to Automatic should do the trick. For a script that checks if sql server and the agent are running you can do a quick google search for "powershell script to check if service is running"... To get the exact name of the service you could get a list of all services by typing NET START from a command prompt.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • Thanks - just checked teh last instance which wasnt running - was set for automatic start on server and agent but hadnt been running, till I manually retsarted it?

  • That means the service is either failing to start and crashing. That's something a DBA or Server Admin would have to look into. A service failing to start or crashing is usually recorded in the event viewer.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • Thanks - I'll look into it.

Viewing 7 posts - 1 through 6 (of 6 total)

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