Display Server Loads?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yo!ijob
    Senior Member
    • Aug 2005
    • 221

    Display Server Loads?

    Since moving servers to a VPS my server loads at the bottom of the forum have gone.

    I haven't done anything, what could be the problem? How do I get them back?

    Thanks
  • Steve Machol
    Former Customer Support Manager
    • Jul 2000
    • 154488

    #2
    The server loads will no longer show if you have open_basedir enabled in php.ini since it can't access /proc/loadavg
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment

    • NeutralizeR
      Senior Member
      • Aug 2005
      • 104
      • 3.8.x

      #3
      Originally posted by Steve Machol
      The server loads will no longer show if you have open_basedir enabled in php.ini since it can't access /proc/loadavg
      But i can see the server load averages in moderator panel?

      AdminCP doesn't display them, ModCP does.
      MsXLabs Forum

      Comment

      • NeutralizeR
        Senior Member
        • Aug 2005
        • 104
        • 3.8.x

        #4
        Open your admincp/index.php file.

        Replace:
        PHP Code:
        // ### MAX LOGGEDIN USERS ################################
        if (intval($vbulletin->maxloggedin['maxonline']) <= ($guests $members))
        {
            
        $vbulletin->maxloggedin['maxonline'] = $guests $members;
            
        $vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
            
        build_datastore('maxloggedin'serialize($vbulletin->maxloggedin), 1);
        }

        if (
        PHP_OS == 'Linux' AND @file_exists('/proc/loadavg') AND $stats = @file_get_contents('/proc/loadavg') AND trim($stats) != '')
        {
            
        $stats explode(' '$stats);
            
        $stats[0] = vb_number_format($stats[0], 2);
            
        $stats[1] = vb_number_format($stats[1], 2);
            
        $stats[2] = vb_number_format($stats[2], 2);

            
        print_label_row($vbphrase['server_load_averages'], "$stats[0]&nbsp;&nbsp;$stats[1]&nbsp;&nbsp;$stats[2] | " construct_phrase($vbphrase['users_online_x_members_y_guests'], vb_number_format($guests $members), vb_number_format($members), vb_number_format($guests)), '''top'NULLfalse);
        }
        else
        {
            
        print_label_row($vbphrase['users_online'], construct_phrase($vbphrase['x_y_members_z_guests'], vb_number_format($guests $members), vb_number_format($members), vb_number_format($guests)), '''top'NULLfalse);

        with:
        PHP Code:
        // ### MAX LOGGEDIN USERS ################################
        if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
        {
            if (
        preg_match("#: ([\d.,]+),\s+([\d.,]+),\s+([\d.,]+)$#"$stats$regs))
            {

                
        $datecut TIMENOW $vbulletin->options['cookietimeout'];
                
        $guestsarry $db->query_first("SELECT COUNT(host) AS sessions FROM " TABLE_PREFIX "session WHERE userid = 0 AND lastactivity > $datecut");
                
        $membersarry $db->query_read("SELECT DISTINCT userid FROM " TABLE_PREFIX "session WHERE userid <> 0 AND lastactivity > $datecut");

                
        $guests intval($guestsarry['sessions']);
                
        $members intval($db->num_rows($membersarry));

                
        $regs[1] = vb_number_format($regs[1], 2);
                
        $regs[2] = vb_number_format($regs[2], 2);
                
        $regs[3] = vb_number_format($regs[3], 2);

                
        print_label_row($vbphrase['server_load_averages'], "$regs[1]&nbsp;&nbsp;$regs[2]&nbsp;&nbsp;$regs[3] | " construct_phrase($vbphrase['users_online_x_members_y_guests'], vb_number_format($guests $members), vb_number_format($members), vb_number_format($guests)), '''top'NULLfalse);
            }

        And you'll have server load averages in your admincp. At least it worked for me.
        MsXLabs Forum

        Comment

        • Steve Machol
          Former Customer Support Manager
          • Jul 2000
          • 154488

          #5
          Originally posted by NeutralizeR
          But i can see the server load averages in moderator panel?

          AdminCP doesn't display them, ModCP does.
          Please report this in the 3.6 Bug Tracker here:

          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment

          • GHOwner
            Senior Member
            • Jun 2007
            • 554
            • 3.8.x

            #6
            Originally posted by Steve Machol
            Please report this in the 3.6 Bug Tracker here:

            http://www.vbulletin.com/forum/project.php?projectid=6
            Well, it can't be a bug. I've upgraded to 3.6.8 recently, and still have Server Load displaying data.

            Server Load Averages 0.27 0.11 0.03 | 1 Users Online (1 members and 0 guests)
            So this is a technical issue of the OP (original poster).

            Comment

            • Steve Machol
              Former Customer Support Manager
              • Jul 2000
              • 154488

              #7
              I was responding to post #3. If you have an issue, then please start your own thread.
              Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
              Change CKEditor Colors to Match Style (for 4.1.4 and above)

              Steve Machol Photography


              Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


              Comment

              • GHOwner
                Senior Member
                • Jun 2007
                • 554
                • 3.8.x

                #8
                Originally posted by Steve Machol
                I was responding to post #3. If you have an issue, then please start your own thread.
                And I responded it must be the thread starters own problem. Personally, i have no issue as he stated in both Admin and Mod CP. Thus, it is system configurations of his new VPS.

                Comment

                • Steve Machol
                  Former Customer Support Manager
                  • Jul 2000
                  • 154488

                  #9
                  That's probably because yous server is not affected. See post #2.

                  His issue is different. These either should show up in both places or neither place. Since he claims it's showing up in one and not the other, I asked him to fill out a support ticket.
                  Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                  Change CKEditor Colors to Match Style (for 4.1.4 and above)

                  Steve Machol Photography


                  Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                  Comment

                  • GHOwner
                    Senior Member
                    • Jun 2007
                    • 554
                    • 3.8.x

                    #10
                    Originally posted by Steve Machol
                    That's probably because yous server is not affected. See post #2.

                    His issue is different. These either should show up in both places or neither place. Since he claims it's showing up in one and not the other, I asked him to fill out a support ticket.
                    I understand my erver is different, or I'd be having the same issues. Personally, if it works in one area, and not the other, then the 2nd question should be if he is running any modifications.

                    Either way, I responded here as I assumed "3.6 Bug Tracker" refers to bugs in the software. Since it works for me, it isn't an actual bug in the software, but technical issues on his side.

                    Sorry for the misunderstanding.

                    Comment

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