ExamNotes.net  -  IT certification portal

ForumsCertResearchTop sitesNewslettersFree email
HomeRegister


Exams Notes
Practice exams
Exam games
Questions by email
Online training
Training videos
College degrees
Boot camps
Book store
Links directory
Tell a friend
For webmasters




General discussions > Public newsgroups > microsoft.public.sqlserver.server > Verifying that the sqlagent is running

Show a Printable Version
Email This Page to Someone!
Receive updates to this thread



Author Verifying that the sqlagent is running
GI
Guest




Registered: Not Yet
Location:
Country:
State:
Certifications:
Working on:

Total Posts: N/A
Verifying that the sqlagent is running

Does anyone have a handy job out there to check to make sure that the
sqlagent is running and if it isn't uses sql mail (xp_sendmail) to let you
know this. I have many alerts setup and they depend on the sqlagent running
to send me notifications. Since I am so dependent on the sqlagent I want
to make sure it is running (maybe checking once or twice a day). I know an
easy solution is to set up a sql job that sends me an e-mail once a day and
if I don't get that e-mail daily then the sqlagent or my exchange server is
down (Too many e-mails). I was hoping to find a better way where somehow
you can verify that the sqlagent is running and if it is not then send an
e-mail using sql mail.

any ideas would be appreciated.


Report this post to a moderator

Old Post 12-05-02 09:23 PM
Reply w/Quote Edit/Delete Message IP: Logged
Jasper Smith
Guest




Registered: Not Yet
Location:
Country:
State:
Certifications:
Working on:

Total Posts: N/A
Re: Verifying that the sqlagent is running

You could set up a scheduled task to execute osql using
AT or the Scheduled Tasks wizard and specify and input
file to test for this e.g.

osql -E -S SERVERNAME -i c:\sqlagent.sql


and sqlagent.sql would contain something like

set nocount on

declare @status varchar(100)
create table #agent(status varchar(100))

insert #agent
exec master..xp_servicecontrol 'QueryState', 'SQLServerAgent'

select @status = status from #agent

if @status <> 'Running.'
begin

exec master..xp_sendmail 'admin@sql.com' , 'SQL Agent down'

end

drop table #agent
go


--
HTH

Jasper Smith (SQL Server MVP)

I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org

"GI" <glenn.illig@healthtrio.com> wrote in message
news:uhXZ1QKnCHA.2444@TK2MSFTNGP10...
> Does anyone have a handy job out there to check to make sure that the
> sqlagent is running and if it isn't uses sql mail (xp_sendmail) to let you
> know this. I have many alerts setup and they depend on the sqlagent

running
> to send me notifications. Since I am so dependent on the sqlagent I want
> to make sure it is running (maybe checking once or twice a day). I know

an
> easy solution is to set up a sql job that sends me an e-mail once a day

and
> if I don't get that e-mail daily then the sqlagent or my exchange server

is
> down (Too many e-mails). I was hoping to find a better way where somehow
> you can verify that the sqlagent is running and if it is not then send an
> e-mail using sql mail.
>
> any ideas would be appreciated.
>
>



Report this post to a moderator

Old Post 12-05-02 11:23 PM
Reply w/Quote Edit/Delete Message IP: Logged
All times are GMT.
Post new thread   Post reply


Forum Jump:
Rate This Thread:
Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author.
Posts: HTML code is OFF. Smilies are ON. vB code is ON. [IMG] code is OFF.
 

ExamNotes forum archive


Powered by: vBulletin 2.2.8
Copyright ©2000, Jelsoft Enterprises Limited.

  Free Braindumps | mcse braindumps