I got an evil idea to take this further: if you really want to duct-tape
a ServersAlive testing system together, you could just set up a browser
somewhere to hit your ServersAlive template, and have the template page
itself automatically email you whenever it hadn't been updated in a
while. For example, you could just open up a browser in your data
center and hit this page, or you could add it to a template that you
leave open on your desktop all day. (That's what I'm adding it to - I
have a personal "home page" that's an SA template, and I rarely look at
the check date/times.)
I sincerely doubt anybody will put this into production, but I got such
a laugh out of doing it that I had to post it here. (I'm in the midst
of Java training, so I needed a break.)
This requires CDONTS on the web server, which is the free email delivery
system included with Windows NT and 2000 servers. For Windows 2003
boxes, you'll need to register CDONTS.dll from an existing server -
email me offlist if you need info on that.
Here's the code to copy/paste into a template. Obviously, you want to
change the "[EMAIL PROTECTED]" email addresses to your own.
<%
Dim intMinSinceLastCheck
intMinSinceLastCheck = DateDiff("n", "<sa_currentshortdate>
<sa_currentshorttime>",NOW())
If intMinSinceLastCheck > 15 then
Response.Write("ServersAliveDown - has not checked in " &
intMinSinceLastCheck & " minutes!")
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "[EMAIL PROTECTED]"
objCDO.To = "[EMAIL PROTECTED]"
objCDO.Subject = "ServersAlive hasn't checked in " &
intMinSinceLastCheck & " minutes!"
objCDO.Body = "You'd better run and check ServersAlive at " &
Request.Servervariables("SERVER_NAME") & Request.Servervariables("URL")
objCDO.Send()
Set objCDO = Nothing
else
Response.Write("ServersAliveOK - last check was " &
intMinSinceLastCheck & " minutes ago.")
End If
%>
<html>
<head>
<meta HTTP-EQUIV="REFRESH" CONTENT="600">
</head>
<body>
</body>
</html>
I'll probably expand this over the next day or two and add it to my
templates page for download. I'm already thinking I could play a
warning klaxon alarm wav file. :-D
Back to training....<sigh>
--------------------------------
Brent Ozar - UniFocus
--------------------------------
"Aluminum to me,
aluminium to some
You can shine like silver all you want
But you're just aluminum."
Barenaked Ladies, Aluminum
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Brent G. Ozar
Sent: Wednesday, October 22, 2003 3:11 PM
To: [EMAIL PROTECTED]
Subject: RE: [SA-list] Monitoring SA
Interesting idea! You could do it with an ASP web template pretty
easily. You can add the below code to an existing template, or add a
new one with just this code, which checks to see if the template has
been updated in the last 15 minutes:
<%
Dim intMinSinceLastCheck
intMinSinceLastCheck = DateDiff("n", "<sa_currentshortdate>
<sa_currentshorttime>",NOW())
If intMinSinceLastCheck > 15 then
Response.Write("ServersAliveDown - has not checked in " &
intMinSinceLastCheck & " minutes!") else
Response.Write("ServersAliveOK - last check was " &
intMinSinceLastCheck & " minutes ago.") End If %>
Just make sure the template is generated with an ASP extension, not
HTML. When the template is built by SA, the source code will look like
this (with the current date instead of 10/22/2003 15:09, of course):
<%
Dim intMinSinceLastCheck
intMinSinceLastCheck = DateDiff("n", "10/22/2003 15:09",NOW()) If
intMinSinceLastCheck > 15 then
Response.Write("ServersAliveDown - has not checked in " &
intMinSinceLastCheck & " minutes!") else
Response.Write("ServersAliveOK - last check was " &
intMinSinceLastCheck & " minutes ago.") End If %>
Then with your second, free edition, you can do a url check on this
template. It should always say "ServersAliveOK", but if it doesn't,
then you know to alert.
If you've got any questions on it, feel free to let me know.
--------------------------------
Brent Ozar - UniFocus
--------------------------------
"Aluminum to me,
aluminium to some
You can shine like silver all you want
But you're just aluminum."
Barenaked Ladies, Aluminum
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ferd J Summer
Sent: Wednesday, October 22, 2003 1:56 PM
To: [EMAIL PROTECTED]
Subject: [SA-list] Monitoring SA
I am having incidences where SA will lock up (especially checking a URL)
and not complete the check cycle or do any additional cycles. It there
anything that I could monitor or look at using a second serveralive on a
different server to notify me that SA has a problem. The keepalive
message is not a good solution as I have to remember when I got that
last message.
Not very helpful during the middle of the night
Ferd Summer
CSC
[EMAIL PROTECTED]
803-333-4774
------------------------------------------------------------------------
----------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the use
of e-mail for such purpose.
------------------------------------------------------------------------
----------------
To unsubscribe from a list, send a mail message to [EMAIL PROTECTED]
With the following in the body of the message:
unsubscribe SAlive
To unsubscribe from a list, send a mail message to [EMAIL PROTECTED]
With the following in the body of the message:
unsubscribe SAlive
To unsubscribe from a list, send a mail message to [EMAIL PROTECTED]
With the following in the body of the message:
unsubscribe SAlive