Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Automatic Alert Generation in the event of SQL Server Cluster Failover


Automatic Alert Generation in the event of SQL Server Cluster Failover

Author
Message
Yogeshwar Phull
Yogeshwar Phull
SSC Eights!
SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)SSC Eights! (926 reputation)

Group: General Forum Members
Points: 926 Visits: 668
Comments posted to this topic are about the item Automatic Alert Generation in the event of SQL Server Cluster Failover
Robert Davis
Robert Davis
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2376 Visits: 1623
What if a failover occurs but the other node fails to come online and it fails back to the original server? No alert will be raised.

What if the cluster shuts down and can't start on either node? No alert will be raised.

You need to monitor externally.



My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master, SQL Server MVP
Database Engineer at BlueMountain Capital Management
alin.selicean
alin.selicean
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 255
I am using a similar approach, but outside the monitored clustered SQL Server. I have added an external application (a .CMD file) as a clustered resource. It uses a SQLCMD script that uses a different instance of SQL server to send an email about the status change:

SQLCMD /S <servername> /E /i M:\ClusterMonitor\ResourceChangeNotification.sql >> M:\ClusterMonitor\ResourceChangeMonitorLog.txt

It still depends on that instance to send notifications and it only looks at SQL Server group (we're also clustering DTC). So I'm not 100% happy with this. But I wasn't able to find any other workaround for this. Are there any tools to monitor for status changes of a clustered resource: goes offline, comes online, cannot be brought online, etc.

I am interested in a solution that will also indicate the resource affected by the change, what the change was, etc. Does anyone know of such a solution ?

Thanks.

Regards,
Alin
christian.heckelmann
christian.heckelmann
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 247
I'm using a SQL Agent Job with the Schedule: "Start automatically when SQL Server Agent starts"
With the following T-SQL Script


DECLARE @SRV VARCHAR(64)
DECLARE @INST VARCHAR(64)
DECLARE @MBODY VARCHAR(255)
DECLARE @SUBJ VARCHAR(255)
SELECT @SRV=CAST(SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS VARCHAR)
SELECT @INST=@@servername

SET @MBODY = 'Active Node for ' + @INST + ' is ' + @SRV
SET @SUBJ = '!!!ALERT!!! - ' + @SRV + ' restarted'
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'DBMAIL',
@recipients = 'mail@domain.com',
@body = @MBODY,
@subject = @SUBJ;




Bye
alin.selicean
alin.selicean
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 255
I'm using that as well, in conjuction with what I already mention, but this is still internal and relies on SQL server services to be successfully brought online.
Jack Corbett
  Jack Corbett
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15582 Visits: 14866
Certainly an out of the box method to be notified of a failover. As mentioned it has some issues, but certainly could be part of an overall plan. I don't have experience dealing with clusters, but I do like the method provided by Tim Ford over at msssqltips, http://www.mssqltips.com/sqlservertip/1663/auto-notification-for-failover-of-a-server-and-restart-of-sql-server-services/ a little better.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
jdneilso
jdneilso
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 37
This is good information.

I've always created a job that would inform me when SQL Server services were restarted and it has served me well.

I have the job send an email to a key group:

EXEC msdb.dbo.sp_send_dbmail
@recipients='dbadmin@oursite.net',
@profile_name = 'Production Database Mail',
@subject = 'SQL Services Restarted on Production DB',
@body = 'Services restarted, possible cluster failover'

Schedule type = "Start automatically when SQL Server Agent starts"

I know its not exactly when a failover happens but I like to know when the services are restarted or the machine is booted anyway.
ebenraja
ebenraja
SSC Journeyman
SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)

Group: General Forum Members
Points: 78 Visits: 258
What kind of performance impact is involved if scheduled to run every seconds in SQL2008 R2 enviroinment or scheduled to run every minute in SQL2005 enviroinment.
This job queries registry parameters will that prove a problem to performance.

BR
Eben
MiguelSQL
MiguelSQL
SSC Veteran
SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)SSC Veteran (258 reputation)

Group: General Forum Members
Points: 258 Visits: 1124
Hello,

About getting the node where the instance is running, you can use the following query:

select Nodename from sys.dm_os_cluster_nodes

or this other one:

select Nodename from ::fn_virtualservernodes()


The query above would give you the names of the nodes on that cluster, and it will list first the active node for that instance... just add a TOP 1 and your are golden without having to access the registry.
ebenraja
ebenraja
SSC Journeyman
SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)

Group: General Forum Members
Points: 78 Visits: 258
Thanks, its useful information.

Coming to the main article where the Author speaks about scheduling the job as a SQL agent job for every minutes or seconds, will that cause any performance impact to the DB engine utilization..

BR
Eben
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search