This is a discussion on Who Turned off the SQL Server AGENT???!!!! within the SQL Server forums, part of the Microsoft SQL Server category; --> Is there a simple way of letting the Database Administrator know when the SQL Agent get turned off? I ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is there a simple way of letting the Database Administrator know when the SQL Agent get turned off? I know this can happen from time to time, but I need a mechanism to shoot me an email or something when this happens. I know -- I can set up a SQL Agent job to do that Any suggestions greatly appreciated!!! RBollinger |
| |||
| robboll, The following script will send a "net send" message and could be run using the Windows Scheduler. You could substitute the net send command with an email using MAPI or SMTPMail (requirems more setup possibly). There should be plenty of scripting examples on Google or Yahoo search. You could also include an itterator (For Each) using SQL DMO to get a list of server names. Dim wsh Set wsh = CreateObject("WScript.Shell") strComputer = "Computer_Name" strUser = "Your_Network_Login_Name" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colServiceList = objWMIService.ExecQuery _ ("Select State from Win32_Service where Name = 'SQLSERVERAGENT'") For Each objService In colServiceList If objService.State <> "Running" Then wsh.Run ("net send " & strUser & " SQLSERVERAGENT Service is not running on " & strComputer & " attempting to start it.") ' start the service wsh.Run ("net start /" & strComputer & " SQLSERVERAGENT") End If Next -- Bill "robboll" <robboll@hotmail.com> wrote in message news:1170779081.371621.32880@p10g2000cwp.googlegro ups.com... > Is there a simple way of letting the Database Administrator know when > the SQL Agent get turned off? I know this can happen from time to > time, but I need a mechanism to shoot me an email or something when > this happens. I know -- I can set up a SQL Agent job to do that > > Any suggestions greatly appreciated!!! > > RBollinger > |
| |||
| > > Is there a simple way of letting the Database Administrator know when > > the SQL Agent get turned off? I know this can happen from time to > > time, but I need a mechanism to shoot me an email or something when > > this happens. I know -- I can set up a SQL Agent job to do that > > > Any suggestions greatly appreciated!!! > > > RBollinger- Hide quoted text - > > - Show quoted text - Do you mean Task Scheduler on the server? Doesn't there need to be an application that runs VB on the server? |
| |||
| robboll, Yes, Task Scheduler. You are running VB Script not VB, which should be available on your server by default. Save the script file with a VBS (not BAS) extention. -- Bill "robboll" <robboll@hotmail.com> wrote in message news:1170800482.966971.157190@v33g2000cwv.googlegr oups.com... >> > Is there a simple way of letting the Database Administrator know when >> > the SQL Agent get turned off? I know this can happen from time to >> > time, but I need a mechanism to shoot me an email or something when >> > this happens. I know -- I can set up a SQL Agent job to do that >> >> > Any suggestions greatly appreciated!!! >> >> > RBollinger- Hide quoted text - >> >> - Show quoted text - > > Do you mean Task Scheduler on the server? Doesn't there need to be an > application that runs VB on the server? > |
| |||
| On Feb 6, 5:07 pm, "AlterEgo" <altereg...@dslextreme.com> wrote: > robboll, > > Yes, Task Scheduler. You are running VB Script not VB, which should be > available on your server by default. Save the script file with a VBS (not > BAS) extention. > > -- Bill > > "robboll" <robb...@hotmail.com> wrote in message > > news:1170800482.966971.157190@v33g2000cwv.googlegr oups.com... > > > > >> > Is there a simple way of letting the Database Administrator know when > >> > the SQL Agent get turned off? I know this can happen from time to > >> > time, but I need a mechanism to shoot me an email or something when > >> > this happens. I know -- I can set up a SQL Agent job to do that > > >> > Any suggestions greatly appreciated!!! > > >> > RBollinger- Hide quoted text - > > >> - Show quoted text - > > > Do you mean Task Scheduler on the server? Doesn't there need to be an > > application that runs VB on the server?- Hide quoted text - > > - Show quoted text - Are you the author of this little jewel? It works like a champ. Can you recommend a good reference for this kind of VB scripting? Something tells me that you can use VB scripting for just about anything that requires maintenance and monitoring -- rather than expensive utilities that have more features than you need. One thing that had me stymied for awhile -- For Messaging to work, the Messaging Service must be running on the server and the clients. Messaging is turned off by default on Windows XP and Windows Server 2003. Thanks again, RBollinger |
| |||
| robboll, Sorry, I forgot about the Messenging Service. Most of the scripts I use I found on the Internet. I don't script often enough to remember the object models, so I just search for them. This one I just happened to have used several years ago to solve a common problem. Novice DBAs and other operators see the "Start service when OS starts" checkbox as checked and sometimes think that Agent starts when you start SQL Server. They forget that starting SQL Server does *not* automatically start the SQL Server Agent, which is always stopped if you stop SQL Server. These links might be a good start for you: http://msdn2.microsoft.com/en-us/library/ms950396.aspx http://www.microsoft.com/technet/scr...arnit.mspx#EXB http://www.microsoft.com/technet/scr....mspx?mfr=true -- Bill "robboll" <robboll@hotmail.com> wrote in message news:1170940248.791749.71630@v33g2000cwv.googlegro ups.com... > On Feb 6, 5:07 pm, "AlterEgo" <altereg...@dslextreme.com> wrote: >> robboll, >> >> Yes, Task Scheduler. You are running VB Script not VB, which should be >> available on your server by default. Save the script file with a VBS (not >> BAS) extention. >> >> -- Bill >> >> "robboll" <robb...@hotmail.com> wrote in message >> >> news:1170800482.966971.157190@v33g2000cwv.googlegr oups.com... >> >> >> >> >> > Is there a simple way of letting the Database Administrator know >> >> > when >> >> > the SQL Agent get turned off? I know this can happen from time to >> >> > time, but I need a mechanism to shoot me an email or something when >> >> > this happens. I know -- I can set up a SQL Agent job to do that >> >> >> > Any suggestions greatly appreciated!!! >> >> >> > RBollinger- Hide quoted text - >> >> >> - Show quoted text - >> >> > Do you mean Task Scheduler on the server? Doesn't there need to be an >> > application that runs VB on the server?- Hide quoted text - >> >> - Show quoted text - > > Are you the author of this little jewel? It works like a champ. > Can you recommend a good reference for this kind of VB scripting? > Something tells me that you can use VB scripting for just about > anything that requires maintenance and monitoring -- rather than > expensive utilities that have more features than you need. > > One thing that had me stymied for awhile -- For Messaging to work, the > Messaging Service must be running on the server and the clients. > Messaging is turned off by default on Windows XP and Windows Server > 2003. > > Thanks again, > RBollinger > > > > > |
| ||||
| On Feb 8, 12:30 pm, "AlterEgo" <altereg...@dslextreme.com> wrote: > robboll, > > Sorry, I forgot about the Messenging Service. > > Most of the scripts I use I found on the Internet. I don't script often > enough to remember the object models, so I just search for them. This one I > just happened to have used several years ago to solve a common problem. > Novice DBAs and other operators see the "Start service when OS starts" > checkbox as checked and sometimes think that Agent starts when you start SQL > Server. They forget that starting SQL Server does *not* automatically start > the SQL Server Agent, which is always stopped if you stop SQL Server. > > These links might be a good start for you: > > http://msdn2.microsoft.com/en-us/lib...s_roa_overview.... > > -- Bill > > "robboll" <robb...@hotmail.com> wrote in message > > news:1170940248.791749.71630@v33g2000cwv.googlegro ups.com... > > > > > On Feb 6, 5:07 pm, "AlterEgo" <altereg...@dslextreme.com> wrote: > >> robboll, > > >> Yes, Task Scheduler. You are running VB Script not VB, which should be > >> available on your server by default. Save the script file with a VBS (not > >> BAS) extention. > > >> -- Bill > > >> "robboll" <robb...@hotmail.com> wrote in message > > >>news:1170800482.966971.157190@v33g2000cwv.google groups.com... > > >> >> > Is there a simple way of letting the Database Administrator know > >> >> > when > >> >> > the SQL Agent get turned off? I know this can happen from time to > >> >> > time, but I need a mechanism to shoot me an email or something when > >> >> > this happens. I know -- I can set up a SQL Agent job to do that > > >> >> > Any suggestions greatly appreciated!!! > > >> >> > RBollinger- Hide quoted text - > > >> >> - Show quoted text - > > >> > Do you mean Task Scheduler on the server? Doesn't there need to be an > >> > application that runs VB on the server?- Hide quoted text - > > >> - Show quoted text - > > > Are you the author of this little jewel? It works like a champ. > > Can you recommend a good reference for this kind of VB scripting? > > Something tells me that you can use VB scripting for just about > > anything that requires maintenance and monitoring -- rather than > > expensive utilities that have more features than you need. > > > One thing that had me stymied for awhile -- For Messaging to work, the > > Messaging Service must be running on the server and the clients. > > Messaging is turned off by default on Windows XP and Windows Server > > 2003. > > > Thanks again, > > RBollinger- Hide quoted text - > > - Show quoted text - Thanks -- I'll check them out! Have you tried this with SQL Server 2005? |