Announcement

Collapse
No announcement yet.

Script to ping my IP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script to ping my IP

    Does such a thing exist? I've been looking for a bit... Basically, I just want it to ping my IP, because I run a game server. I just want it to report something like "Server is up" or "Server is down" and ping every 1-5 minutes or so. If I could somehow put it on the vbulletin forumhome it would be even better. I tried writing one but it didn't work (grrrr)
    *insert signature here*

  • #2
    http://www.hotscripts.com/PHP/Script...ng_Tools/Ping/
    You're my Prince of Peace
    And I will live my life for You

    Comment


    • #3
      I tried those, but those all require you to enter your IP into a page. I need to be able to automatically ping when a user browses the site (or ping at fixed times and display the results)

      For an example, go to http://ro.pak0.com and look on the right hand side. The green names means the server is up, red means it is down.

      The linkstatus one is about right, since it does check automatically. But it checks http, and unless I put a httpd of some kind on my comp, it won't work. Actually, that's not a bad idea...

      And, after a bit of modifying the script, it now shows it correctly. Thanks.
      *insert signature here*

      Comment


      • #4
        there you go, edit it to match your needs, upload it to your server, save as type .php and launch it
        PHP Code:
        <?php

        error_reporting 
        (E_ALL);

        /* Allow the script to hang around waiting for connections. */

        set_time_limit (0);

        $telnetclient "zeth";
        $remotehost[0] = "abandonedrealms.net";
        $remoteport[0] = "9000";
        $remotehost[1] = "cnn.com";
        $remoteport[1] = "80";
        $remotehost[2] = "freebsd.org";
        $remoteport[2] = "80";

        $c count($remotehost);
        $c2 count($remoteport);
        if(
        $c != $c2){
            die(
        "You must have both remoteport and remotehost specified for all servers.");
        }

        ?>

        <html>
        <head>
        <title>Server status checker</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        </head>

        <body bgcolor="#FFFFFF" text="#000000">
        <table width="100" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
          <tr>
            <td>
              <table width="291" border="0" cellspacing="0" cellpadding="0">
                <tr bgcolor="#00CCFF">
                  <td><b><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="2">Server
                    name</font></b></td>
                  <td><b><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" size="2">Status</font></b></td>
                </tr>
                <?php
        for ($i 0$i $c$i++) {
        $fp fsockopen("$remotehost[$i]"$remoteport[$i], $errno$errstr);

        if (!
        $fp) {
            
        ?>
               <tr bgcolor="#FFFFFF">
                  <td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php echo $remotehost[$i].":".$remoteport[$i]; ?></font></td>
                  <td>
                    <div align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1">DOWN</font></div>
                  </td>
                </tr>
             <?php
            
        } else {
             
        ?>
               <tr bgcolor="#FFFFFF">
                  <td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php echo $remotehost[$i].":".$remoteport[$i]; ?></font></td>
                  <td>
                    <div align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1">UP</font></div>
                  </td>
                </tr>
             <?php
        fclose 
        ($fp);
        }
        }
                
        ?>
              </table>
            </td>
          </tr>
        </table>
        </body>
        </html>
        You're my Prince of Peace
        And I will live my life for You

        Comment


        • #5
          Wow, that's even better! Now I don't have to run that httpd. Is there any way to integrate this into displaying on vBulletin? I tried but I keep getting parse errors on my test board.
          *insert signature here*

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X