vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Administrative and Maintenance Tools - TOP Server Load on AdminCP homepage (https://vborg.vbsupport.ru/showthread.php?t=197588)

Adult SEO 11-28-2008 10:00 PM

TOP Server Load on AdminCP homepage
 
This mod will add the top server load statistics in your vBulletin admincp (if your server installation allows execution of programs via PHP)

https://vborg.vbsupport.ru/

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();

https://vborg.vbsupport.ru/external/...chmentid=90438

Update (V.1.3)

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

This addition was suggested by accludetuner

bashy 11-29-2008 04:11 PM

Wow, top mod, really useful thank you :)

TheCatcher 11-29-2008 04:43 PM

nice thanks


but...

Code:


Datenbankfehler in vBulletin 3.7.4:
Invalid SQL:
INSERT INTO x_product
(productid, title, description, version, active, url, versioncheckurl)
VALUES
('server_load',
'Server Load',
'This mod will add a TOP server load statistics on the AdminCP homepage.',
'1.0',
1,
'',
'');
MySQL-Fehler : Duplicate entry 'server_load' for key 'PRIMARY'
Fehler-Nr. : 1062
Fehler-Zeit : Saturday, 29.11.2008 @ 19:41:54
Datum : Saturday, 29.11.2008 @ 19:41:54
Skript : plugin.php?do=productimport
Referrer : plugin.php?do=productadd
IP-Adresse : 87.122.114.27
Benutzername : Sebastian
Klassenname : vB_Database_MySQLi
MySQL-Version : 5.1.22-rc


Adult SEO 11-29-2008 04:51 PM

The product key has been changed to top_server_load

TheCatcher 11-29-2008 05:06 PM

thanks!

Now everything is super!

Doug Nelson 11-29-2008 09:51 PM

I don't understand. Does this launch putty?

digicom 11-29-2008 10:33 PM

Installed Thankyou :up:

momo2 11-30-2008 03:28 AM

not a bad tool to have, if u don't have root access.. for dedicated server is fine, what about share hosting ?

rainyleaves 12-01-2008 08:26 AM

Awesome! But Doesn't work for vb3.8. Sorry Uninstall..

Adult SEO 12-01-2008 08:33 AM

Quote:

Originally Posted by rainyleaves (Post 1676288)
Awesome! But Doesn't work for vb3.8. Sorry Uninstall..

Can you please let me know what error you received?

rainyleaves 12-01-2008 11:41 AM

I just can get title "TOP - Server Load" on the admin home.
I can't see statistic data.

Adult SEO 12-01-2008 11:52 AM

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.

rainyleaves 12-01-2008 12:19 PM

I see...Problem caused by my server.
Thanks, for your quick reply. :)
Awesome mod!!

TheArve 12-06-2008 09:24 PM

Looks like hosts won't allow it,,

Adult SEO 12-11-2008 02:35 PM

Quote:

Where do we upload the file to please ?
This is a product (plugin), you can install it from your AdminCP (plugins)

7lanet 12-11-2008 03:11 PM

vbseo cause me great times Load server
Is this product solve such a problem
How?

Adult SEO 12-11-2008 05:18 PM

This mod will only tell you what processes are consuming the most resources and other information about your server. It will not optimize the server.

You can however detect processes that are running for to long or consuming to much resources and kill them.

Adult SEO 12-17-2008 12:38 PM

If you are having problems with MySQL tables being locked etc. you can use this plugin to kill the mysql process (fast fix) en enable all other users to continue using the forum (the searching user will then ofcourse receive a 404 or server error).

Just lookup the process (for example the one mysql process that is running for 10 minutes already) and kill it with 2 clicks.

Artes_Marciales 01-08-2009 07:52 AM

D?ont work for my : (

Quote:

This mod will add the top server load statistics in your vBulletin admincp (if your server installation allows execution of programs via PHP)
How I activate it?
php.ini??
http.conf??

Thanks!!

chesterano 03-21-2009 10:07 AM

Doesn't work for vb3.8 :( how activate execution via PHP?

ForumsMods 04-19-2009 03:45 PM

It show all process or only of my account??

appsfinder 04-20-2009 06:01 AM

Quote:

Originally Posted by Adult SEO (Post 1676397)
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?:confused:

Adult SEO 04-20-2009 07:24 AM

Quote:

Originally Posted by appsfinder (Post 1794964)
how do i get this running on my host?:confused:

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.

Adult SEO 04-20-2009 07:25 AM

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.

MmS1 04-20-2009 06:55 PM

Installed ur gr8 man

accludetuner 06-21-2009 07:10 PM

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*

Adult SEO 07-07-2009 05:58 AM

Quote:

Originally Posted by accludetuner (Post 1834271)
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.

accludetuner 07-17-2009 10:08 PM

nice :)

bashy 07-26-2009 10:16 AM

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?


All times are GMT. The time now is 06:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01201 seconds
  • Memory Usage 1,816KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete