Is there a way to query from SQL Server in TSQL which node is active in another cluster group in the same cluster?

I have a cluster with two cluster groups, one with resources for SQL Server, one with resources for the application connecting to SQL Server. In order to send alerts from SQL Server I need to find out which node is active in the application group. Is there a way to do that in TSQL? I can find out the name of the active SQL node.

link|improve this question

68% accept rate
You might be better asking on StackOverflow: if the info is available programmatically, you can do it via .net or such direct from the app. Or CLR in SQL Server. Although it is a DBA.SE question, it'll involve some code monkeying... – gbn Feb 3 at 11:07
Also need to define "send alerts from SQL Server" a little more. Using powershell or cluster/exe you can find the active node for all the cluster groups but this is not exposed in T-SQL. You can find the active node of the SQL group using the serverproperty function but this will not work for a cluster group that doesn't host SQL, like your application tier. – Jason Cumberland Feb 3 at 15:30
Sending alerts is just using databasemail to send mails to operators. But those mails need to contain the name of the active application node. I guess I have to go with running cluster.exe from SQL Server, even though doing such is discouraged (but if there is no other way...). – Andrew J. Brehm Feb 3 at 17:12
A WMI query might be more lightweight than running cluster.exe – Eric Nicholson Mar 15 at 15:05
Which WMI query would give me the info I need? – Andrew J. Brehm Mar 15 at 19:26
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.