D
darrel
I swear I've read you can do this somewhere before, but don't recall where
or what it'd even be called to do the correct googling.
What I've been asked to do is make a 'dashboard' app that checks the status
of various servers. If they are down, show an error.
I found/modified this snippet:
---
Try
Dim req As Net.HttpWebRequest = Net.WebRequest.Create("your url")
Dim res As Net.HttpWebResponse = req.GetResponse()
Dim str As IO.Stream = res.GetResponseStream()
Return New IO.StreamReader(str).ReadToEnd()
Catch ex As Exception
Return ex.Message
End Try
End Function
---
2 issues:
1) When I try to call the function ala:
<%=checkURL("http://google.com")%>
I get this error: "Invalid URI: The format of the URI could not be
determined."
Unfortunately, that appears to be a common SharePoint error, so Google
results are a bit cluttered.
2) Even if this does work, will it return anything if the server times out
(the main thing we're looking to check for?
-Darrel
or what it'd even be called to do the correct googling.
What I've been asked to do is make a 'dashboard' app that checks the status
of various servers. If they are down, show an error.
I found/modified this snippet:
---
Try
Dim req As Net.HttpWebRequest = Net.WebRequest.Create("your url")
Dim res As Net.HttpWebResponse = req.GetResponse()
Dim str As IO.Stream = res.GetResponseStream()
Return New IO.StreamReader(str).ReadToEnd()
Catch ex As Exception
Return ex.Message
End Try
End Function
---
2 issues:
1) When I try to call the function ala:
<%=checkURL("http://google.com")%>
I get this error: "Invalid URI: The format of the URI could not be
determined."
Unfortunately, that appears to be a common SharePoint error, so Google
results are a bit cluttered.
2) Even if this does work, will it return anything if the server times out
(the main thing we're looking to check for?
-Darrel