Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Setting Notification email (When the job fails) Expand / Collapse
Author
Message
Posted Monday, November 19, 2012 12:13 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 5:08 PM
Points: 182, Visits: 734
Hi Everyone,

I have setup a job(SQLS ERVER 2008 R2) in two servers Server1.Domain1 & Server1.Domain2 and I have enabled notification email when the job

fails.But when we recieve the notification(in case of job failure) email,on the subject of email it says "Subject: SQL Server Job System: Job1

completed on \\Server1".

Subject does not show ,if this has happened on Server1.Domain1 or Server1.Domain2?Is there anyway that we can add domain name on notification

email.

Thanks
Post #1386536
Posted Tuesday, November 20, 2012 2:58 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
Aspet Golestanian Namagerdi (11/19/2012)
I have enabled notification email when the job
are you using database mail ?



-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1386765
Posted Tuesday, November 20, 2012 9:16 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 5:08 PM
Points: 182, Visits: 734
No,When I set the job I added notification through GUI(when the job failed,send an email to DBA GROUP).
Post #1386993
Posted Wednesday, November 21, 2012 1:58 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:53 AM
Points: 5,218, Visits: 5,072
On the notifications area of the job, you have set it to email a operator if the job fails, correct?

If so you will need to ensure that you have enabled and configured database mail.
Ensured that the SQL server is allows to relay mail.
Ensured that you have stopped any anti-virus / spyware programs from blocking mass mail worms.
Ensure you have set the Alert System of the SQL Agent properties access to Database Mail and the profile you have created.
Once all donw restart the SQL Agent service to pick up the new configuration.

After which is the job will fail it will send the alert.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1387287
Posted Wednesday, November 21, 2012 9:19 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 5:08 PM
Points: 182, Visits: 734
I recieve the alert email,but on subject of email it does not show the Full name of server.I mean it just shows Failure on Server1.The problem is, we have multiple Server1 in different domains and we need to have the full server on alert email subject.
Post #1387477
Posted Thursday, November 22, 2012 2:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:53 AM
Points: 5,218, Visits: 5,072
Your into the inner workings now of how SQL Agent passes the subject from the Agent alert system to sp_notify_operator. My best bet would be for you to create your own email step within the job to send an email when a step fails by using the on failure actions of the other steps, and passing in the FQDN using powershell as you cant get the FQDN from SQL itself, you need to get it from the Windows host.



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1387764
Posted Tuesday, November 27, 2012 9:44 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 9:23 AM
Points: 24, Visits: 195
You can specify a display name in the Outgoing mail server (SMTP) settings of the Database Mail account. Make these unique on both instances and you should be able to differentiate between the two when they arrive in your inbox.
Post #1389290
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse