Check remote server status

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Check remote server status

    My website redirect a certain page to another on an different server because
    that (generated) page is always up-to-date.
    Only that server isn't stable all the time.
    I'm looking for a quick way to check if the server (and the page) is online
    (by retrieving the headers?) so that if it isn't I can use redirect to a
    less up-to-date page.

    Can anyone help me with this???


    John Smith Guest

  2. Similar Questions and Discussions

    1. Check status of FCS
      Hello! I want to build a php-page that can check the status of a FCS-service. Like it is possible through the control panel. For example I...
    2. Check for File on Remote Server
      Hello, I want to check to ensure that a file exists on a remote server before executing other code. I tried: <cfhttp method="get"...
    3. how can i check and decide the caps Lock status ?
      i want to know if the caps lock is turned on right now or not and to turn it on how can i do it ? thanks
    4. How to check the status of a DB2 Connection
      We use DB2CLI. Does any one know if it is possible to check the status of a DB2 Connection (SQLHdbc) before actually using it. This will help in...
    5. How to check server status using InetCtls.Inet?
      Set Inet = Server.CreateObject("InetCtls.Inet.1") Inet.URL = "http://www.yahoo.com/" Inet.AccessType = icDirect Inet.Protocol = icHTTP...
  3. #2

    Default Re: Check remote server status

    "John Smith" <someone@nobody.com> wrote in message
    news:bve88j$if1$1@news1.tilbu1.nb.home.nl...
    > My website redirect a certain page to another on an different server
    because
    > that (generated) page is always up-to-date.
    > Only that server isn't stable all the time.
    > I'm looking for a quick way to check if the server (and the page) is
    online
    > (by retrieving the headers?) so that if it isn't I can use redirect to a
    > less up-to-date page.
    >
    > Can anyone help me with this???
    >
    >
    $otherPage = implode("",file("http://www.othersite.com/otherpage.html"));

    --
    Mike Bradley
    [url]http://www.gzentools.com[/url] -- free online php tools


    CountScubula Guest

  4. #3

    Default Re: Check remote server status

    This gives me the file, but I want to redirect to that server if it's online
    by using file() it waits and waits if the server is down.
    I did something similar (along time ago) with Perl there I used an
    HTTPstatus-request for the file.

    "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    news:xSzSb.7956$BO6.2722@newssvr29.news.prodigy.co m...
    > "John Smith" <someone@nobody.com> wrote in message
    > news:bve88j$if1$1@news1.tilbu1.nb.home.nl...
    > > My website redirect a certain page to another on an different server
    > because
    > > that (generated) page is always up-to-date.
    > > Only that server isn't stable all the time.
    > > I'm looking for a quick way to check if the server (and the page) is
    > online
    > > (by retrieving the headers?) so that if it isn't I can use redirect to a
    > > less up-to-date page.
    > >
    > > Can anyone help me with this???
    > >
    > >
    >
    > $otherPage = implode("",file("http://www.othersite.com/otherpage.html"));
    >
    > --
    > Mike Bradley
    > [url]http://www.gzentools.com[/url] -- free online php tools
    >
    >

    John Smith Guest

  5. #4

    Default Re: Check remote server status

    ok, if you just want the headers, then it will still wait and wait if the
    server is down.

    Now, are you refering to server down as the http service or the physical
    server itself?

    you can try to open a socket to the machine?

    Are you trying to see if it is up on every request from your page? not good
    idea if so.

    try getting the file() its simpler, and do it from a cron job that runs ever
    X minutes, thus saving bandwidth, cpu usage etc.. and eliminating any delays
    if server is down.


    --
    Mike Bradley
    [url]http://www.gzentools.com[/url] -- free online php tools
    "John Smith" <someone@nobody.com> wrote in message
    news:bvfrbn$c61$1@news2.tilbu1.nb.home.nl...
    > This gives me the file, but I want to redirect to that server if it's
    online
    > by using file() it waits and waits if the server is down.
    > I did something similar (along time ago) with Perl there I used an
    > HTTPstatus-request for the file.
    >
    > "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    > news:xSzSb.7956$BO6.2722@newssvr29.news.prodigy.co m...
    > > "John Smith" <someone@nobody.com> wrote in message
    > > news:bve88j$if1$1@news1.tilbu1.nb.home.nl...
    > > > My website redirect a certain page to another on an different server
    > > because
    > > > that (generated) page is always up-to-date.
    > > > Only that server isn't stable all the time.
    > > > I'm looking for a quick way to check if the server (and the page) is
    > > online
    > > > (by retrieving the headers?) so that if it isn't I can use redirect to
    a
    > > > less up-to-date page.
    > > >
    > > > Can anyone help me with this???
    > > >
    > > >
    > >
    > > $otherPage =
    implode("",file("http://www.othersite.com/otherpage.html"));
    > >
    > > --
    > > Mike Bradley
    > > [url]http://www.gzentools.com[/url] -- free online php tools
    > >
    > >
    >
    >

    CountScubula Guest

  6. #5

    Default Re: Check remote server status

    I meant the service.

    Thanks I will try that and of course I won't check this on every page.
    I don't if I can use a cron job since the server is not hosted by me.


    "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    news:wsKSb.18278$871.1368@newssvr27.news.prodigy.c om...
    > ok, if you just want the headers, then it will still wait and wait if the
    > server is down.
    >
    > Now, are you refering to server down as the http service or the physical
    > server itself?
    >
    > you can try to open a socket to the machine?
    >
    > Are you trying to see if it is up on every request from your page? not
    good
    > idea if so.
    >
    > try getting the file() its simpler, and do it from a cron job that runs
    ever
    > X minutes, thus saving bandwidth, cpu usage etc.. and eliminating any
    delays
    > if server is down.
    >
    >
    > --
    > Mike Bradley
    > [url]http://www.gzentools.com[/url] -- free online php tools
    > "John Smith" <someone@nobody.com> wrote in message
    > news:bvfrbn$c61$1@news2.tilbu1.nb.home.nl...
    > > This gives me the file, but I want to redirect to that server if it's
    > online
    > > by using file() it waits and waits if the server is down.
    > > I did something similar (along time ago) with Perl there I used an
    > > HTTPstatus-request for the file.
    > >
    > > "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    > > news:xSzSb.7956$BO6.2722@newssvr29.news.prodigy.co m...
    > > > "John Smith" <someone@nobody.com> wrote in message
    > > > news:bve88j$if1$1@news1.tilbu1.nb.home.nl...
    > > > > My website redirect a certain page to another on an different server
    > > > because
    > > > > that (generated) page is always up-to-date.
    > > > > Only that server isn't stable all the time.
    > > > > I'm looking for a quick way to check if the server (and the page) is
    > > > online
    > > > > (by retrieving the headers?) so that if it isn't I can use redirect
    to
    > a
    > > > > less up-to-date page.
    > > > >
    > > > > Can anyone help me with this???
    > > > >
    > > > >
    > > >
    > > > $otherPage =
    > implode("",file("http://www.othersite.com/otherpage.html"));
    > > >
    > > > --
    > > > Mike Bradley
    > > > [url]http://www.gzentools.com[/url] -- free online php tools
    > > >
    > > >
    > >
    > >
    >
    >

    John Smith Guest

  7. #6

    Default Re: Check remote server status

    I've used fsockopen($host, 80) to make a HEAD-request
    It works fine.
    It doesn't wait and wait if the server is down because of the connection
    between the servers is so short and fast. (at least not for 1 request)
    I also buffer the result so that it's checked only when the server isn't
    down.
    If it's down it will check only once each X minutes en the next X minutes
    will be the other page.

    ThanX for the help I've never used sockets before with PHP

    p.s. perhaps PHP needs a better and faster way to check headers.

    "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    news:wsKSb.18278$871.1368@newssvr27.news.prodigy.c om...
    > ok, if you just want the headers, then it will still wait and wait if the
    > server is down.
    >
    > Now, are you refering to server down as the http service or the physical
    > server itself?
    >
    > you can try to open a socket to the machine?
    >
    > Are you trying to see if it is up on every request from your page? not
    good
    > idea if so.
    >
    > try getting the file() its simpler, and do it from a cron job that runs
    ever
    > X minutes, thus saving bandwidth, cpu usage etc.. and eliminating any
    delays
    > if server is down.
    >
    >
    > --
    > Mike Bradley
    > [url]http://www.gzentools.com[/url] -- free online php tools
    > "John Smith" <someone@nobody.com> wrote in message
    > news:bvfrbn$c61$1@news2.tilbu1.nb.home.nl...
    > > This gives me the file, but I want to redirect to that server if it's
    > online
    > > by using file() it waits and waits if the server is down.
    > > I did something similar (along time ago) with Perl there I used an
    > > HTTPstatus-request for the file.
    > >
    > > "CountScubula" <me@scantek.hotmail.com> schreef in bericht
    > > news:xSzSb.7956$BO6.2722@newssvr29.news.prodigy.co m...
    > > > "John Smith" <someone@nobody.com> wrote in message
    > > > news:bve88j$if1$1@news1.tilbu1.nb.home.nl...
    > > > > My website redirect a certain page to another on an different server
    > > > because
    > > > > that (generated) page is always up-to-date.
    > > > > Only that server isn't stable all the time.
    > > > > I'm looking for a quick way to check if the server (and the page) is
    > > > online
    > > > > (by retrieving the headers?) so that if it isn't I can use redirect
    to
    > a
    > > > > less up-to-date page.
    > > > >
    > > > > Can anyone help me with this???
    > > > >
    > > > >
    > > >
    > > > $otherPage =
    > implode("",file("http://www.othersite.com/otherpage.html"));
    > > >
    > > > --
    > > > Mike Bradley
    > > > [url]http://www.gzentools.com[/url] -- free online php tools
    > > >
    > > >
    > >
    > >
    >
    >

    John Smith Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139