Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
TOP Server Load on AdminCP homepage Details »»
TOP Server Load on AdminCP homepage
Version: 1.3, by Adult SEO Adult SEO is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.x Rating:
Released: 11-28-2008 Last Update: 07-06-2009 Installs: 51
Uses Plugins
Re-useable Code Translations  
No support by the author.

This mod will add the top server load statistics in your vBulletin admincp (if your server installation allows execution of programs via PHP)



Update (V.1.2)

Added kill process function to be able to kill a process with a click of the button.

Note: this will require the ability to execute kill -9 process_id from PHP exec();



Update (V.1.3)

Added SuperAdministrator check, to allow just super admins to see and manage server processes.

This addition was suggested by accludetuner

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 04-19-2009, 03:45 PM
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Location: Argentina
Posts: 667
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It show all process or only of my account??
Reply With Quote
  #23  
Old 04-20-2009, 06:01 AM
appsfinder appsfinder is offline
 
Join Date: Apr 2007
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Adult SEO View Post
This is more likely caused by TOP not being able to be executed from within PHP. If you see the TOP - Server Load bar it means the plugin is running.
how do i get this running on my host?
Reply With Quote
  #24  
Old 04-20-2009, 07:24 AM
Adult SEO's Avatar
Adult SEO Adult SEO is offline
 
Join Date: May 2006
Location: The Netherlands
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by appsfinder View Post
how do i get this running on my host?
Well, if you don't know this, it may be better to leave it disabled as it can be abused.

This plugin is safe, however, others may not be. And it would for example be possible for someone with bad intentions to install a virus on your server, or steal information etc.
Reply With Quote
  #25  
Old 04-20-2009, 07:25 AM
Adult SEO's Avatar
Adult SEO Adult SEO is offline
 
Join Date: May 2006
Location: The Netherlands
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It may be possible however, for an experienced host, to just enable the execution of sertain commands such as top. Then it would be secure.
Reply With Quote
  #26  
Old 04-20-2009, 06:55 PM
MmS1 MmS1 is offline
 
Join Date: Nov 2008
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed ur gr8 man
Reply With Quote
  #27  
Old 06-21-2009, 07:10 PM
accludetuner accludetuner is offline
 
Join Date: Jun 2009
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got this working on 3.8.2. I have it using the hook of "admin_index_main3". I also made slight change to the code to only allow Super Administrators to be able to view/kill processes due to the possible problems an unknowing user could cause. Here's my code:

PHP Code:
if (in_array($vbulletin->userinfo['userid'], preg_split('#\s*,\s*#s'$vbulletin->config['SpecialUsers']['superadministrators'], -1PREG_SPLIT_NO_EMPTY)) )
{

/* Server Load */
if ($_REQUEST["kill_process"] && is_numeric($_REQUEST["kill_process"])) {
        
$process_id $_REQUEST["kill_process"];
        if (
$_POST["no"]) {
        
        } elseif (
$_POST["yes"]) {
            
exec("kill -9 ".$process_id."");
            
print_table_start();
            
print_table_header('<a name="killprocess"></a>TOP - Server Load - Kill Process '.$process_id.'',1);
            
print_description_row('Process killed!',false,1);
            
print_table_footer(2''''false);
        } else {
            
exec('ls -la /proc/'.$process_id.'/'$procdata$error );
            
$proctxt '';
            foreach (
$procdata as $procline) {
                
$proctxt .= trim($procline)."\n";
            }
            
print_table_start();
            
print_table_header('<a name="killprocess"></a>TOP - Server Load - Kill Process '.$process_id.'',1);
            
print_description_row('<form method="post" action="index.php?do=home&kill_process='.$process_id.'#killprocess">
                Are you sure you want to kill this process? 
                <div style="padding:10px;"><textarea style="width:550px;height:200px;">'
.$proctxt.'</textarea></div><input type="submit" name="yes" value="Yes"> <input type="submit" name="no" value="No">
            </form>'
,false,1);
            
print_table_footer(2''''false);
        }
    }

    
print_table_start();
    
print_table_header('TOP - Server Load',12);
    
exec('top n 1 b i'$top$error );
    
    
$is_toptable false;
    foreach (
$top as $topline) {
        
$topline trim($topline);
        if (!
$topline) { continue 1; }
        if (!
$is_toptable && !preg_match('|^PID|Ui',$topline)) {
            if (
preg_match('|^top - (.*)$|Ui',$topline,$out)) {
                
print_description_row('<b>TOP:</b> '.$out[1],false,12);
            } else {
                if (
preg_match('|^([^:]+): (.*)$|Ui',$topline,$out)) {
                    
print_description_row('<b>'.$out[1].':</b> '.$out[2],false,12);
                } else {
                    
print_description_row($topline,false,12);
                }
            }
        } else {
            
$topvals preg_split('|[ ]+|s',$topline);
            if (!
$is_toptable) {
                foreach (
$topvals as $key => $value) {
                    
$topvals[$key] = '<b>'.$value.'</b>';
                }
            } else {
                
$topvals[0] .= ' <a href="index.php?do=home&kill_process='.$topvals[0].'#killprocess" style="color:red;">X</a>';
            }
            
print_cells_row(array(
                    
$topvals[0],
                    
$topvals[1],
                    
$topvals[2],
                    
$topvals[3],
                    
$topvals[4],
                    
$topvals[5],
                    
$topvals[6],
                    
$topvals[7],
                    
$topvals[8],
                    
$topvals[9],
                    
$topvals[10],
                    
$topvals[11]
                ), 
00, -5'top'11);
            
            
$is_toptable true;
        }
    }
    
print_table_footer(2''''false);
    

Thanks! *Installed*
Reply With Quote
  #28  
Old 07-07-2009, 05:58 AM
Adult SEO's Avatar
Adult SEO Adult SEO is offline
 
Join Date: May 2006
Location: The Netherlands
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by accludetuner View Post
Got this working on 3.8.2. I have it using the hook of "admin_index_main3". I also made slight change to the code to only allow Super Administrators to be able to view/kill processes due to the possible problems an unknowing user could cause. Here's my code:
I have implemented your suggestion and posted the mod in the 3.8.x section.
Reply With Quote
  #29  
Old 07-17-2009, 10:08 PM
accludetuner accludetuner is offline
 
Join Date: Jun 2009
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice
Reply With Quote
  #30  
Old 07-26-2009, 10:16 AM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, thanks for this

I have it installed on my forum, but i would like to use it on my normal website (secured)
is there a way to implement it as a stand alone php script please?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06873 seconds
  • Memory Usage 2,341KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete