Solved

Monitoring cluster SQL Server

Posted on 2010-11-19
3
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:la-tempestad
ID: 34179213
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
ID: 34187033
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
ID: 37141436
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
create insert script based on records in a table 4 29
sccm importing drivers 4 84
SQL Error - Query 6 55
SQL Server 2005 running VERY slowly on new hardware 22 65
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 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