No announcement yet.

ASP Script

  • Filter
  • Time
  • Show
Clear All
new posts

  • ASP Script

    Anyone have a handy ASP script that will ping a server every x minutes and return if it's online or not. I'm trying to do this on intranet only for three streaming audio servers.


    Server Status:
    Audio1 Online
    Audio2 Online
    Audio3 OFFLINE

  • #2
    Ping from Classic ASP can be done, but it's a bit of a pain in the ass. An HTTP pull is easier - if Shoutcast, you could go after 7.html on each of the servers. Here's a quick sample... just replace the HOST_AND_PORT with your info. To poll every x minutes, you'd just want to do a meta refresh on the page with the code.


    extURL = "http://HOST_AND_PORT/7.html"
    Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP") "GET", exturl, True
    Call xml.Send
    If xml.ReadyState <> 4 Then
    xml.waitForResponse 1
    ' 1 = Seconds before declaring a timeout has occurred. Adjust to your tastes.
    End If
    If xml.ReadyState <> 4 Then
    response.write "Audio 1:<font color='#AA0000'><b>OFFLINE</b></font>"
    response.write "Audio 1:<font color='#00AA00'>Online</font>"
    End If
    Set xml = Nothing

    Atlantic Sound Factory
    Licensed by StreamLicensing | Powered by Fast Serv | Radionomy Broadcaster


    • #3
      my programmer suggested the following ...

      good luck.
      also agreed html scripts are better.
      jewish dating sites, catholic dating sites, black dating sites


      • #4
        I'm a big fan of doing this type of thing using big brother. Might be overkill for this application though.
        Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.


        • #5
          The above script that dotme works, however that only works for HTTP. The streaming audio servers (not SHOUTcast btw) doesn't have HTTP installed. Could it be modified to use a generic Windows port to verify if it's up or not..?