Server Monitoring

Yash

Bass
Dated: Aug 25, 2005

We are in the process of setting up a new detailed server stats website called jodopulse.com for our customers/resellers. This site is hosted on a different network and would be available even if our network would to go down.

Development has not yet completed but this new site would have current statuses on al servers, any downtime notices, bandwidth/cpu/ram graphs for each server and daily/weekly/monthly uptime reports.

The actual completion of the site may take 2 weeks, but for now I'm providing links to simply a current status page for our servers

Windows Web Servers:
http://jodopulse.com:8080/pubgrp?uid=76EE495F-1D11-4F06-A9CE-A5BAEB0EED3F

MSSQL Servers:
http://jodopulse.com:8080/pubgrp?uid=6CB20798-874F-44E1-AA7A-48ADD6BAC62E

Mail Servers:
http://jodopulse.com:8080/pubgrp?uid=7E7F4896-DFB7-4958-BA97-A37E416F27AC

Linux Servers:
http://jodopulse.com:8080/pubgrp?uid=7FD1F035-6A2A-4023-A41F-EE65F77D6953

The small linear graph shown against each server is the response time of that server over a 2 hour period. Any red lines indicate a timeout or downtime.

These current status links are VERY accurate. They check the services every 60 seconds from multiple locations. For the web servers, it actually checks whether ASP, ASPX, PHP are responding. And for the database servers, it actually checks whether its responding to queries. For the mail servers, it actually attempts to retrieve email from test accounts and sends dummy emails via SMTP every 60 seconds.. to ensure it is working
 
To clarify, the response time given (eg 500ms) is not the latency between the probe and the server. It is the actual time the server takes to respond to the query initiated by the probe
 
Yes it will. I am reconfiguring IPCheck from scratch. It's database got corrupted for some reason :(
 
Yes, but during the move it had some issues in monitoring, and the status did not want to leave the "paused" state, Yash is working on reinstalling it all.
 
I reconfigured IPCheck from scratch last night. I have updated the links on top. You can now see live status again.
 
Yash,

Is there anyway these could be made available to resellers? Maybe with domain alias?

Thanks
Greg
 
Greggers said:
Is there anyway these could be made available to resellers? Maybe with domain alias?

Greg, i don't know if this help you (or others resellers here), but with this small piece of code (VbScript, ASP) it is possible to be implemented perfectly anywhere adapting it completely.
I use it in my host domain, you can see how it is in action on: http://enterprisedreams.net/datacenter.asp

Code:
<%
'' In order to get this thing working you need to do only one thing
'' 1) The variable below "TextDomain" needs to be assigned to be the domain name you use for your hosting

''  1) Enter the domain name you use for your hosting here, eg: yourdomain.com
TextDomain = "YourDomain"

StrPage = Request.ServerVariables("SCRIPT_NAME")

'' Of course I know most of you will be able to adapt this more to suit your own needs, but at least it gets you started.
'' Please, no remove this
'' Code By Juan C. Barreiro
'' EnterpriseDreams Solutions
'' www.enterprisedreams.net

Function ReplaceHTML(CodeHtml,TextDomain,CodeBase)
	CodeHtml = replace(CodeHtml,"<a href=""http://www.paessler.com"">www.paessler.com</a>","<a href=""http://www.paessler.com"" target=""_blank"">www.paessler.com</a>")
	CodeHtml = Replace(CodeHtml,"JodoHost",TextDomain)
	CodeHtml = Replace(CodeHtml,"Probe","Test...")
	CodeHtml = Replace(CodeHtml,"Linux","Unix")
''	CodeHtml = Replace(CodeHtml,"VPS3","VPS3")
	CodeHtml = replace(CodeHtml,"<table border=0 cellpadding=2 cellspacing=1 bgcolor=""#ffffff"">","<table width=""515"" border=""0"" cellpadding=""2"" cellspacing=""3"" bgcolor=""FFFAF7"">")
	CodeHtml = replace(CodeHtml,"bgcolor=#CCFFCC","class=info")
	CodeHtml = replace(CodeHtml,"bgcolor=#FF9999","class=alert")
	CodeHtml = replace(CodeHtml,"bgcolor=FF9999","bgcolor=FF0000")
	CodeHtml = replace(CodeHtml,"bgcolor=CCFFCC","bgcolor=FFFAF7")
	CodeHtml = replace(CodeHtml,"bgcolor=#ccccff","class=paused")
	CodeHtml = replace(CodeHtml,"bgcolor=""#efefef""","class=heads")
	CodeHtml = replace(CodeHtml,"/smallgraph?","/status.asp?image")
	CodeHtml = replace(CodeHtml,"tdclass=pie","td class=pie")
	ReplaceHTML = CodeHtml
End Function

Function ServerStatus(CodeBase,varOpenURL,InicioCadena,FinCadena,TextDomain)
	On Error Resume Next
	Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
	objXMLHTTP.Open "GET", CodeBase, False
		objXMLHTTP.Send
		CodeHtml = objXMLHTTP.responseText
	Set objXMLHTTP = Nothing
	CodeHtml = ReplaceHTML(RemoveHTML(CodeHtml,InicioCadena,FinCadena),TextDomain,CodeBase)
	If Len(CodeHtml) > 0 Then
		ServerStatus = CodeHtml & VBCrlf
	Else
		ServerStatus = MsgError() & VBCrlf
	End If
End Function

Function RemoveHTML(CodeHtml,InicioCadena,FinCadena)
	While InStr(1, CodeHtml, InicioCadena, vbTextCompare) > 0
		ini = InStr(1, CodeHtml, InicioCadena, vbTextCompare) + Len(InicioCadena)
		fin = InStr(1, CodeHtml, FinCadena, vbTextCompare)
		CodeHtml = Mid(CodeHtml, ini, fin - ini)
	Wend
	RemoveHTML = CodeHtml
End Function

Function MsgError()
	MsgError = MsgError & "<div class=""pie"">" & VBCrlf
	MsgError = MsgError & "<p>Currently, your account credentials are not sufficient to perform this action. </p>" & VBCrlf
	MsgError = MsgError & "<p>" & VBCrlf
	MsgError = MsgError & "<p>To go back to the previous html page, <a href=""javascript:window.history.back();"">click here</a>.</p>" & VBCrlf
	MsgError = MsgError & "<p>" & VBCrlf
	MsgError = MsgError & "<p>If the account credentials you specified are sufficient for this action, an ip lockout may be in effect, " & VBCrlf
	MsgError = MsgError & TextDomain & " Monitor has an automatic lockout mechanism which will prevents unauthorized access from:</p>" & VBCrlf
	MsgError = MsgError & "<p>" & VBCrlf
	MsgError = MsgError & "<ul>" & VBCrlf
	MsgError = MsgError & "<li> specified ip ranges</li>" & VBCrlf
	MsgError = MsgError & "<li> repeated attempts at actions outside of their account permissions</li>" & VBCrlf
	MsgError = MsgError & "</ul>" & VBCrlf
	MsgError = MsgError & "</p>" & VBCrlf
	MsgError = MsgError & "</div>" & VBCrlf
End Function

If Len(request.querystring) > 0 Then varOpenURL = request.querystring Else varOpenURL = "unix"

If Left(varOpenURL,5) = "image" Then

	On Error Resume Next
	Response.ContentType = "image/png"
	Set HTTPObj = Server.CreateObject("AspHTTP.Conn")
	HTTPObj.Url = "http://jodopulse.com:8080"&Replace(varOpenURL,"image","/smallgraph?")
	HTTPObj.GetURL
	Response.BinaryWrite HTTPObj.BinaryData
	Set HTTPObj = Nothing
	Response.End

End If

Select Case(varOpenURL)
Case "win"
	CodeBase = "http://jodopulse.com:8080/pubgrp?uid=76EE495F-1D11-4F06-A9CE-A5BAEB0EED3F"
Case "mssql"
	CodeBase = "http://jodopulse.com:8080/pubgrp?uid=6CB20798-874F-44E1-AA7A-48ADD6BAC62E"
Case "mail"
	CodeBase = "http://jodopulse.com:8080/pubgrp?uid=7E7F4896-DFB7-4958-BA97-A37E416F27AC"
Case "unix"
	CodeBase = "http://jodopulse.com:8080/pubgrp?uid=7FD1F035-6A2A-4023-A41F-EE65F77D6953"
Case else
	CodeBase = "http://jodopulse.com:8080/pubgrp?uid=7FD1F035-6A2A-4023-A41F-EE65F77D6953"
End Select

TextoCorteInicio = "<body>"
TextoCorteFinal = "</body>"
%>
<html>
<head>
<title><%=TextDomain%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta HTTP-EQUIV="refresh" content="60;URL=<%=StrPage%>?<%=varOpenURL%>">
<style>
td {font-size: 8pt; font-family: Arial, Verdana, Tahoma;}
.info { background-color: #FFFAF7; color: #636B70; font-weigth: bold;}
.heads { color: #FFFFFF; background-color: #5656A9; font-weigth: bold;}
.paused { background-color: #FFCC99; color: #5656A9; font-weigth: bold;}
.alert {background-color: #FF0000;color:#000000;}
</style>
</head>
<body>
<table width="520" border="0" cellspacing="4" cellpadding="5" align="center">
<tr>
    <td align="center"><a href="<%=StrPage%>?win">Windows Servers</a></td>
    <td align="center"><a href="<%=StrPage%>?unix">Unix Servers</a></td>
    <td align="center"><a href="<%=StrPage%>?mssql">MS-SQL Servers</a></td>
    <td align="center"><a href="<%=StrPage%>?mail">Mail Servers</a></td>
</tr>
</table>
<table width="520" border="0" cellspacing="0" cellpadding="0" align="center" style="border: solid 1px #000000;">
<tr>
    <td valign="top"><%=ServerStatus(CodeBase,varOpenURL,TextoCorteInicio,TextoCorteFinal,TextDomain)%></td>
</tr>
</table>
</body>
</html>

Note: Save this code as status.asp to work (in any case also it can be including in another page by means of includes files, but status.asp to have to exist to "create" the images)

I hope that this can help.
 
Hm, it seems that you have forgot the MySQL Servers. Also, I wonder if is possible to get them per server base (for instance, I only need Win 10, MS SQL5 and MySQL3 :))
 
zaboss said:
Hm, it seems that you have forgot the MySQL Servers.

mySQL runs on the Unix servers and there is a probe for them on the unix page.

Excellent script - thanks. Just one small problem.. The graphs don't display. Any ideas?

Thanks
Greg
 
Back
Top