Configuring Alerts in servers with limited support | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Configuring Alerts in servers with limited support

I need to monitor jobs and i should be alerted if any job fails. I can not use mail or netsend option since both services are disabled. Pager option is also ruled out due to lack of facility.Kindly explain all the other possible ways to implement a better mechanism to trigger an alert.
You can use Service Broker to forward alerts for you. I do not know the technical details, but it was a topic discussed at PASS this year.
is there any particular reason for not enabling Database Mail in SQL Server 2005. Madhu
Refer to the Microsoft website for Notification services too in this regard. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
I believe you can create SSIS package and schedule it to run everty 1/5 minutes and send an email.. In SSIS:
Use SQL EXEC TASK to check the fauled jobs if there are any failed jobs…Send the email notification using MIAL TASK in SSIS. I don’t think you need to configure the sql mail to use this MAIL task in SSIS.
Mohammed U.
Thanx a lot for all those who took the strain to reply me.. I found an alternate way with which i spotted out all those jobs which failed by querying sysjobhistory table for jobs having status other than "1". P.S: Mohammed : Could you please explain a bit more bout SSIS??
quote:Originally posted by sainarayanan I need to monitor jobs and i should be alerted if any job fails. I can not use mail or netsend option since both services are disabled. Pager option is also ruled out due to lack of facility.Kindly explain all the other possible ways to implement a better mechanism to trigger an alert.

Take your time to read through Books online in this case. Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
Use the following script to get the details of failed and cancelled jobs into a table in SQL EXECUTE TASK in SSIS once it is succeeded you send email using MAIL TASK in SSIS pacakge to send an email….. <br /><br />declare @days tinyint <br />select @days = 1 <br />DECLARE <br /> @job_id UNIQUEIDENTIFIER ,<br /> @job_name sysname ,<br /> @step_id INT ,<br /> @sql_message_id INT ,<br /> @sql_severity INT ,<br /> @start_run_date INT , — YYYYMMDD<br /> @end_run_date INT , — YYYYMMDD<br /> @start_run_time INT , — HHMMSS<br /> @end_run_time INT , — HHMMSS<br /> @minimum_run_duration INT , — HHMMSS<br /> @run_status INT , — SQLAGENT_EXEC_X code<br /> @minimum_retries INT ,<br /> @oldest_first INT , — Or 1<br /> @server NVARCHAR(30) <br /><br /> SELECT @job_id = NULL,<br /> @job_name = NULL,<br /> @step_id = NULL,<br /> @sql_message_id = NULL,<br /> @sql_severity = NULL,<br /> @start_run_date = NULL, — YYYYMMDD<br /> @end_run_date = NULL, — YYYYMMDD<br /> @start_run_time = NULL, — HHMMSS<br /> @end_run_time = NULL, — HHMMSS<br /> @minimum_run_duration = NULL, — HHMMSS<br /> @run_status = NULL, — SQLAGENT_EXEC_X code<br /> @minimum_retries = NULL,<br /> @oldest_first = 0, — Or 1<br /> @server = NULL<br /><br /> SELECT –sjh.instance_id, — This is included just for ordering purposes<br /> –sj.job_id,<br /> server = case sjh.server when ‘(local)’ then @@servername <br />else sjh.server end,<br /> job_name = sj.name,<br /> sjh.step_id,<br /> sjh.step_name,<br /> –sjh.sql_message_id,<br /> –sjh.sql_severity,<br /> sjh.message,<br /> RunStatus = case sjh.run_status when 0 then ‘failed’ when 3 then ‘Cancelled’ end,<br /> — sjh.run_date,<br /> — sjh.run_time,<br /> –sjh.run_duration,<br />–Convert Integer date to regular datetime<br />SUBSTRING(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),5,2) + ‘/’ + <br />RIGHT(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),2) + ‘/’ + <br />LEFT(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),4) as run_date<br /><br />–Change run time into something you can reecognize (hh:mm<img src=’/community/emoticons/emotion-7.gif’ alt=’:s’ />s)<br />, LEFT(RIGHT(‘000000’ + CAST(run_time AS VARCHAR(10)),6),2) + ‘:’ + <br /> SUBSTRING(RIGHT(‘000000’ + CAST(run_time AS VARCHAR(10)),6),3,2) + ‘:’ + <br /> RIGHT(RIGHT(‘000000′ + CAST(run_time AS VARCHAR(10)),6),2) as run_time<br /><br />–Change run duration into something you caan recognize (hh:mm<img src=’/community/emoticons/emotion-7.gif’ alt=’:s’ />s)<br />, LEFT(RIGHT(‘000000’ + CAST(run_duration AS VARCHAR(10)),6),2) + ‘:’ + <br /> SUBSTRING(RIGHT(‘000000’ + CAST(run_duration AS VARCHAR(10)),6),3,2) + ‘:’ + <br /> RIGHT(RIGHT(‘000000′ + CAST(run_duration AS VARCHAR(10)),6),2) run_duration,<br /> operator_emailed = so1.name,<br /> operator_netsent = so2.name,<br /> operator_paged = so3.name<br /> –sjh.retries_attempted<br /><br /> FROM msdb.dbo.sysjobhistory sjh<br /> LEFT OUTER JOIN msdb.dbo.sysoperators so1 ON (sjh.operator_id_emailed = so1.id)<br /> LEFT OUTER JOIN msdb.dbo.sysoperators so2 ON (sjh.operator_id_netsent = so2.id)<br /> LEFT OUTER JOIN msdb.dbo.sysoperators so3 ON (sjh.operator_id_paged = so3.id),<br /> msdb.dbo.sysjobs_view sj<br /> WHERE (sj.job_id = sjh.job_id)<br /> AND ((@job_id IS NULL) OR (@job_id = sjh.job_id))<br /> AND ((@step_id IS NULL) OR (@step_id = sjh.step_id))<br /> AND ((@sql_message_id IS NULL) OR (@sql_message_id = sjh.sql_message_id))<br /> AND ((@sql_severity IS NULL) OR (@sql_severity = sjh.sql_severity))<br /> AND ((@start_run_date IS NULL) OR (sjh.run_date &gt;= @start_run_date))<br /> AND ((@end_run_date IS NULL) OR (sjh.run_date &lt;= @end_run_date))<br /> AND ((@start_run_time IS NULL) OR (sjh.run_time &gt;= @start_run_time))<br /> AND ((@end_run_time IS NULL) OR (sjh.run_time &lt;= @end_run_time))<br /> AND ((@minimum_run_duration IS NULL) OR (sjh.run_duration &gt;= @minimum_run_duration))<br /> AND ((@run_status IS NULL) OR (@run_status = sjh.run_status))<br /> AND ((@minimum_retries IS NULL) OR (sjh.retries_attempted &gt;= @minimum_retries))<br /> AND ((@server IS NULL) OR (sjh.server = @server))<br /> AND sjh.run_status in (0,3)<br /> AND sjh.step_id &lt;&gt;0<br /> AND SUBSTRING(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),5,2) + ‘/’ + <br /> RIGHT(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),2) + ‘/’ + <br /> LEFT(CAST(sjh.run_date AS CHAR(<img src=’/community/emoticons/emotion-11.gif’ alt=’8)’ />),4) &gt; getdate() – @days<br /> ORDER BY sjh.server –(sjh.instance_id * @order_by)<br /><br /><br /><br />Mohammed U.
]]>