Results 1 to 3 of 3

Thread: Server Status Request (Php)

  1. #1
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Server Status Request (Php)

    I am wondering if there is a script that would check my computer/another computer to see if a server (IRCd) is online/offline and display the result on the hompage.

    I am also wondering if it would be possible to check if a client (my bot) is connected to the server and what channels it is on. Possibly using the script to query the IRC server with a whois and reporting back part of the raw data.
    Last edited by Separ; 01-27-2008 at 03:22 AM.

  2. #2
    Join Date
    Aug 2007
    Location
    Ohio
    Posts
    79
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Default

    The first part, checking if the server is online, is pretty easy. You'd have to hunt around for the second part, as I don't know anything about how you'd do that.

    For the first part you'd use the fsockopen function.

    Code:
    $server_host = "irc.example.com";
    $server_port = 6667;
    
    $conn = @fsockopen($server_host, $server_port, $errno, $err_string, 3);
    if($conn === false) {
          // server is offline
    }
    else {
          // server is online
    }
    If you want to go more in depth into PHP & IRC, I found this article: Connecting to an IRC server with PHP

  3. #3
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hehe, thanks ^_^

    I should really take it upon myself to learn php properly. The second part would be nice tho but I will search around for it. I have seen it done before with eggdrop shells.

Bookmarks

Posting Permissions

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