Unix Technical Forum

Who Turned off the SQL Server AGENT???!!!!

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 12:15 PM
robboll
 
Posts: n/a
Default Who Turned off the SQL Server AGENT???!!!!

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 12:15 PM
AlterEgo
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

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
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-01-2008, 12:15 PM
robboll
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

> > 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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-01-2008, 12:15 PM
AlterEgo
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

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?
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-01-2008, 12:16 PM
robboll
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

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





Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-01-2008, 12:16 PM
AlterEgo
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

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
>
>
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-01-2008, 12:17 PM
robboll
 
Posts: n/a
Default Re: Who Turned off the SQL Server AGENT???!!!!

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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com