It's even easier if you want to use SA's built-in web check - no need for an external check.  Use code like the below, and monitor the page for the keyword "ALIVE".  It will fail whenever the page hasn't been updated in 10 minutes.
 
<%
Dim intMinutes
intMinutes = cLng(DateDiff("N", "<sa_currentshortdate> <sa_currentshorttime>", now))
If intMinutes > 10 then
 Response.Write("UH OH!")
else
 Response.Write("ALIVE")
End If
%>
 
 
 
--------------------------------
Brent Ozar - UniFocus
--------------------------------
"Be who you are and say what you feel,
 because those who mind don't matter
 and those who matter don't mind."
         Dr. Seuss
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 9:42 AM
To: [EMAIL PROTECTED]
Subject: RE: [SA-list] Monitoring the monitoring software

Cool idea, thanks! The group that manages SQL here, is actually already running their own instance of SA, they got bought into when I first did, but never moved past v3.x. Anyway, so we were talking about setting up monitors for each other SA server.
 
Would you have to set that up as an external check some how to have SA look at the webpage that is generated? I can't think of a way to do it with SA's built in web check. That sounds like an ideal method just to be able to keep a watch on it...
 
 
Thanks!!!!
 
Jesse.


From: Brent G. Ozar [mailto:[EMAIL PROTECTED]
Posted At: Wednesday, January 28, 2004 9:56 AM
Posted To: Servers Alive mailing list
Conversation: [SA-list] Monitoring the monitoring software
Subject: RE: [SA-list] Monitoring the monitoring software

I have a low-tech method of monitoring it.  I have a "home page" that I leave my browser up on my desktop at all times, and it's set to refresh to itself every 5 minutes.  That page is actually an ServersAlive ASP template (among other things) so I can see how my servers are doing.
 
The page includes code that will test the current date against the date that the page was generated by SA.  The template code looks like this:
 
<%
Dim intMinutes
intMinutes = cLng(DateDiff("N", "<sa_currentshortdate> <sa_currentshorttime>", now))
If intMinutes > 10 and intMinutes < 30 then
 'Put your email code here
 Dim objCDO
 Set objCDO = Server.CreateObject("CDONTS.NewMail")
 objCDO.From = "[EMAIL PROTECTED]"
 objCDO.To = "[EMAIL PROTECTED]"
 objCDO.Subject = "ServersAlive has not generated a template in " & intMinutes & " minutes!"
 objCDO.Body = "Go take a look."
 objCDO.Send()
 Set objCDO = Nothing
End If
%>
 
When ServersAlive runs, it replaces the <sa_currentshortdate> <sa_currentshorttime> tags with the date and time that the page was generated.  If the page doesn't get generated for 10 minutes, then the emailing logic is triggered, and I get an email.  It stops emailing after 30 minutes because if I'm not getting the emails, I'm probably not around to fix the problem.
 
It's not bulletproof: it will only work if you leave a web page open that refreshes itself.  But it's a great way to monitor SA if it rarely goes down, and if you don't want to hassle with running a separate instance of SA.  If you wanted to run a separate instance of SA on another box, you could actually use similar logic to have the second SA monitor the outputted templates of the first SA.
 
Brent
 
 
 
--------------------------------
Brent Ozar - UniFocus
--------------------------------
"Be who you are and say what you feel,
 because those who mind don't matter
 and those who matter don't mind."
         Dr. Seuss
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 8:05 AM
To: [EMAIL PROTECTED]
Subject: [SA-list] Monitoring the monitoring software

List, and Dirk, 3 times in the past 4 days, our instance of Servers alive has suddenly stopped responding. The service is shown to be in the "Running" state still, but if you view it under task manager, it shows "not responding". I initially noticed it because our SA generated page had a date that was about 3 hours behind the other day. And then, it has happened almost everyday, at different times. We are running version 4.0.1557, as a service.

The log doesn't seem to show too much, here's a clip of when it happened, it just stopped, and I didn't notice until about 11 last night when I restarted the service:

Tuesday, January 27, 2004 5:07:10 PM Chicago Router
Tuesday, January 27, 2004 5:07:11 PM Chicago Router OK with a successrate of 100% and an average roundtriptime of 65.6ms
Tuesday, January 27, 2004 5:07:11 PM CHIEX1 PING
Tuesday, January 27, 2004 5:07:11 PM CHIEX1 PING OK with a successrate of 100% and an average roundtriptime of 53ms
Tuesday, January 27, 2004 5:07:12 PM GetServiceStatus MSExchangeIS: Running
Tuesday, January 27, 2004 5:07:12 PM NTService check of MSExchangeIS on CHIEX1 OK
Tuesday, January 27, 2004 5:07:13 PM GetServiceStatus MSExchangeMTA: Running
Tuesday, January 27, 2004 5:07:13 PM NTService check of MSExchangeMTA on CHIEX1 OK
Tuesday, January 27, 2004 5:07:14 PM GetServiceStatus ScanMail_RealTimeScan: Running
Tuesday, January 27, 2004 5:07:14 PM NTService check of ScanMail_RealTimeScan on CHIEX1 OK
Tuesday, January 27, 2004 5:07:14 PM Checking CHIEX1 SMTP
Tuesday, January 27, 2Tuesday, January 27, 2004 11:41:53 PM Servers Alive version 4.0.1557.3
Tuesday, January 27, 2004 11:41:53 PM Running on Microsoft Windows 2000 Server (2195) Service Pack 3
Tuesday, January 27, 2004 11:41:53 PM Oracle Core40.dll/core35.dll/oracore8.dll/oracore9.dll library not available
Tuesday, January 27, 2004 11:41:53 PM SQL 7.0/2000 libs available
Tuesday, January 27, 2004 11:41:53 PM SQL libs found, by default using v7
Tuesday, January 27, 2004 11:41:53 PM Netware library's not available
Tuesday, January 27, 2004 11:41:53 PM DUN installed and available for SA
Tuesday, January 27, 2004 11:42:09 PM Check cycle starts ( 1- 1)
Tuesday, January 27, 2004 11:42:09 PM Tampa Router
Tuesday, January 27, 2004 11:42:09 PM Tampa Router OK with a successrate of 100% and an average roundtriptime of 31.4ms

Any ideas? Alternativly, is ther a way that we can monitor for the unresponsivness from another server running a 2nd instance of  SA? Checking the service won't work...

 

 

Thanks!!

 

Jesse.

Reply via email to