Results 1 to 12 of 12
  1. #1
    Join Date
    Jun 2006
    Posts
    92

    MySQL monitor shows MySQL as offline when it's not

    Hello there,

    I've been racking my brains with this problem for the last couple of months and have made zero progress. I've asked a lot of people if they know what might be wrong here, but none of them have any idea.

    Basically, the problem is that any sort of service monitor I put on my server shows MySQL as being down/offline, even when I know for sure it's up and running perfectly fine. All other services report a green light.

    The mysqld service is running on port 3306, which is open both inbound and outbound on my APF config, so as far as I can tell it's nothing to do with the firewall (I won't rule that out though).

    The other odd thing is that MySQL shows a green light within WHM, but not anywhere else.

    Does anyone know what might be wrong here? Am I missing something entirely fundamental and obvious?
    http://www.uniballhq.com - Free online multiplayer game

  2. #2
    What mysql monitoring software are you using?

    What method does it use to test the port?

  3. #3
    Join Date
    Jun 2006
    Posts
    92
    I have used various scripts. The most recent is MiniMonitor that comes with WHMXtra. Another I got off my billing software's community forum, which essentially is the same script that the billing software itself uses to monitor the services. All of them show the same results (everything green except mysql).

    This is the script I got off the community forum:

    Code:
    //configure script
    $timeout = "1";
    
    $self = $_SERVER['SERVER_ADDR'];
    
    
    //set service checks
    $port[1] = "80";       $service[1] = "Apache";                  $address[1] =$self;
    $port[2] = "21";       $service[2] = "FTP";                     $address[2] =$self;
    $port[3] = "3306";     $service[3] = "MYSQL";                   $address[3] =$self;
    $port[4] = "25";       $service[4] = "Email(POP3)";             $address[4] =$self;
    $port[5] = "26";       $service[5] = "Email(POP3 on port 26)";  $address[5] =$self;
    $port[6] = "143";      $service[6] = "Email(IMAP)";             $address[6] =$self;
    $port[7] = "2095";     $service[7] = "Webmail";                 $address[7] =$self;
    $port[8] = "2082";     $service[8] = "Cpanel";                  $address[8] =$self;
    $port[9] = "80";       $service[9] = "Internet Connection";     $address[9] ="google.com";
    $port[10] = "2086";     $service[10] = "WHM";                     $address[10] =$self;
    
    //
    // NO NEED TO EDIT BEYOND HERE
    // UNLESS YOU WISH TO CHANGE STYLE OF RESULTS
    //
    
    //count arrays
    $ports = count($port);
    $ports = $ports + 1;
    $count = 1;
    
    //beggin table for status
    $data .= "<table width='480' border='1' cellspacing='0' cellpadding='3' style='border-collapse:collapse' bordercolor='#333333' align='center'>";
    
    while($count < $ports){
    
         if($address[$count]==""){
           $address[$count] = "";
         }
    
            $fp = @fsockopen("$address[$count]", $port[$count], $errno, $errstr, $timeout);
            if (!$fp) {
                $data .= "<tr><td>Server IP: $self</td><td><b>$service[$count]</b></td><td bgcolor='#FFC6C6'><img src=elements/default/templates/alp_admin/images/offline.gif> </td></tr>";
            } else {
                $data .= "<tr><td>Server IP: $self</td><td><b>$service[$count]</b></td><td bgcolor='#D9FFB3'><img src=elements/default/templates/alp_admin/images/online.gif></td></tr>";
                fclose($fp);
            }
        $count++;
    
    }
    
    //close table
    $data .= "</table>";
    echo $data;
    You can view the script in action here.
    http://www.uniballhq.com - Free online multiplayer game

  4. #4
    Join Date
    Jun 2006
    Posts
    92
    No one have any idea what might be wrong then?
    http://www.uniballhq.com - Free online multiplayer game

  5. #5
    Double check your firewall setting, that port is definately closed from the outside.

    C:\Documents and Settings\oscar>telnet 72.21.41.130 3306
    Connecting To 72.21.41.130...Could not open connection to the host, on port 3306
    : Connect failed

  6. #6
    Join Date
    Jun 2006
    Posts
    92
    Port 3306 is listed in both IG_TCP_CPORTS and EG_TCP_CPORTS in my APF config. Is there anywhere else it should be listed?
    http://www.uniballhq.com - Free online multiplayer game

  7. #7
    You only need it in IG_TCP_CPORTS

    Try stopping the firewall and check your monitor.

    If it still says its blocked check with your upstream provider to see if they are blocking you.

  8. #8
    Join Date
    Jun 2006
    Posts
    92
    My APF is actually going a bit crazy at the moment, so I'm going to reinstall it. I'll let you know what happens afterwards.
    http://www.uniballhq.com - Free online multiplayer game

  9. #9
    Join Date
    Jul 2005
    Posts
    364
    Have you disabled mysql-networking or are did you try to access MySQL from localhost/127.0.0.1?

    Mini

  10. #10
    Join Date
    Jun 2006
    Posts
    92
    I just reinstalled APF. Stopped the APF service and checked the mysql monitor, no change, so it can't be my firewall.

    As for mysql-networking, the skip-networking is not listed in my.cnf so I assume mysql-networking is enabled.

    MySQL definitely works from localhost because all of my MySQL driven sites work absolutely fine!
    http://www.uniballhq.com - Free online multiplayer game

  11. #11
    Join Date
    Jun 2006
    Posts
    92
    Hah, I guess this truly is a mystery. This is my last try to find out what the monkeys is causing this
    http://www.uniballhq.com - Free online multiplayer game

  12. #12
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,683
    You may want to look at replacing APF with CSF - APF isn't being developed any more as far as I know and CSF is now in wide use and has a WHM interface available, ie you can control it all from WHM, including updating it when it changes.

Posting Permissions

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