Solved

Monitoring cluster SQL Server

Posted on 2010-11-19
3
334 Views
Last Modified: 2012-05-10
Hi,

I have 2 SQL Servers in a cluster.
I need to monitor both the servers in a cluter to find which is up and which is down.
so whenever I do a failover it has to show the first server SQL01 is down-View1 SQL query
I have to do the same thing when the second server down,  has to show SQL02 is down-view2 SQL query.

we have got our own inhouse monitor application running on asp.net which can pass the SQL view as a parameter with relevant columns
for monitoring purposes.

I need to crate 2 views like this(at least this is the logic)
CREATE VIEW dbo.SQL01
declare @var1 as varchar(30)
set @var1 = cast(serverproperty('ComputerNamePhysicalNetBIOS') as varchar)
if
@var1<>'SQL01'(when it is not SQL01,I know that it has been failed over to SQL02)


thanks
la
0
Comment
Question by:la-tempestad
  • 2
3 Comments
 
LVL 1

Author Comment

by:la-tempestad
Comment Utility
We wanted to use our monitoring.aspx program.
It is not a problem for us to get the alerts using our own system.
But in this case the first time I have to use serverproperty function to get some results.
I don't know how to create conditional VIEW's for system functions like this "SERVERPROPERTY"

I have created another VIEW only for finding the cluster server name using,

CREATE VIEW dbo.ClusterName
(ServerName) as select serverproperty('ComputerNamePhysicalNetBIOS')

and when I pass "ServerName" as the field input-I get the active cluster name.

But my problem is how I will write conditions in a view especially for "SERVERPROPERTY" function to find out

New View1 SQL01- condition if Servername <> SQL01 -----(so whenever we fail over, this monitor should goes down as it is not SQL01)
output as SQL02.

New View2 SQL02- condition if ServerName <>SQL02---(same here.)
output as SQL01.

thanks
la
0
 
LVL 1

Author Comment

by:la-tempestad
Comment Utility
I just found out the solution myself.


CREATE VIEW [dbo].[Server1]
 (Server1)as SELECT cast(serverproperty('ComputerNamePhysicalNetBIOS') as varchar(50))
                   where cast(serverproperty('ComputerNamePhysicalNetBIOS') as varchar(50)) !='SQL01'


Now I can call this view to trigger the monitor page to stay up or down.
if the value is not 'SQL01' in the Server1(field) the monitor goes down.

thanks
la
0
 

Accepted Solution

by:
EE_AutoDeleter earned 0 total points
Comment Utility
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This is a fairly complicated script that will install the required prerequisites to install SCCM 2012 R2 on a server.  It was designed under the functional model in order to compartmentalize each step required, reducing the overall complexity.  The …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now