vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   My Server Info in AdminCP (https://vborg.vbsupport.ru/showthread.php?t=92416)

Dream 07-17-2005 10:00 PM

My Server Info in AdminCP
 
This is a script that I used outside the admincp, that shows some server info.

- Shows server time with exec(date)
- Shows server load with file_get_contents("/proc/loadavg") (same as microstats plugin)
- Shows memory usage with exec(free)
- Shows free disk space with exec(df)
- phpinfo() link
- Shows MySQL Stats with mysql_stat()
- Shows MySQL Status with "SHOW STATUS" query
- Shows MySQL Vars with "SHOW VARIABLES" query

Its superadmin only.

Installation
- Upload "server_info.php" to your admincp
- Upload "cpnav_serverinfo.xml" to your includes/xml
- Reload your AdminCP, its under "Server Info"

jesus likes pie 07-18-2005 01:51 PM

ooooh

jesus likes pie 07-18-2005 03:26 PM

O.K works fine. One question..


Quote:

Server Load file_get_contents("/proc/loadavg")

failed
whats that mean? Is something wrong with my server?

MrNase 07-18-2005 08:58 PM

Are you running Linux?

Are you sure the 'loadavg' in the folder 'proc' exists?

Chris M 07-18-2005 11:22 PM

If you don't have proc, replace in server_info.php:
PHP Code:

    $loadavg = @file_get_contents("/proc/loadavg");
    if (
$loadavg) {
        
$regs explode(" ",$loadavg);
        
$serverload='Server Loads: <b>' $regs[0] .'</b> ' $regs[1] . ' : ' $regs[2];
    } else {
        
$serverload 'failed';
    } 

with:
PHP Code:

    if ($loadavg = @file_get_contents("/proc/loadavg")) {
 
        
$regs explode(" ",$loadavg);
        
$serverload 'Server Loads: <b>' $regs[0] .'</b> ' $regs[1] . ' : ' $regs[2];
 
    }elseif (
$stats=@exec('uptime')) {
 
        
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
        
$serverload 'Server Loads: <b>' $regs[0] .'</b> ' $regs[1] . ' : ' $regs[2];
 
    } 

That should work :)

Edit: Yes that does work :)

Satan

Dream 07-19-2005 12:11 AM

thanks satan can I use that in an update?

and does anyone know the best way to get "server memory usage" and "disk space used/free"?

Chris M 07-19-2005 12:47 AM

Quote:

Originally Posted by Dream
thanks satan can I use that in an update?

and does anyone know the best way to get "server memory usage" and "disk space used/free"?

Sure you can - You may want to play about with it though :)

For server memory usage, try looking at the php function "memory_get_usage" :)

Satan

utw-Mephisto 08-17-2005 06:24 AM

Works smoothly :)

Chrissicom 10-18-2005 07:53 AM

Any way to make this work on Windows 2003??

gsm4arab1 10-18-2005 09:52 AM

thanks jesus likes pie

Kihon Kata 10-18-2005 12:35 PM

Quote:

Originally Posted by jesus likes pie
ooooh

Fatal error: Call to undefined function: rpm_print_stop_back() in /home/httpd/vhosts/makeuptalk.com/httpdocs/forums/admincp/server_info.php on line 17

Yes, I am running Fedora

Any Ideas?

ideenwerk 10-21-2005 08:14 AM

Works fine and is very useful, thanks! :up:

Flow Fusion 10-21-2005 12:57 PM

Thanks.

eXtremeTim 10-29-2005 04:15 AM

umm yea

PHP Code:

rpm_print_stop_back 

when you use a function its usualy nicer if its a real function that is defined.

Anybody who doesnt have permission to view the page will get that nice error tony was having.

Boofo 11-29-2005 02:31 PM

My site went down last night due to the var dir getting filled up with logs, apparently. I was told by the Host that this hack could cause that. I want to check and see if anyone else has run into this before I remove anything.

The strange thing is that I have only run this once since moving to the new serever and it was yesterday, a little while before I got the "too many connections" error.

Anyone have any ideas on this?

puertoblack2003 11-29-2005 02:41 PM

Quote:

Originally Posted by Boofo
My site went down last night due to the var dir getting filled up with logs, apparently. I was told by the Host that this hack could cause that. I want to check and see if anyone else has run into this before I remove anything.

The strange thing is that I have only run this once since moving to the new serever and it was yesterday, a little while before I got the "too many connections" error.

Anyone have any ideas on this?

hey boofo that's the problem i was having i deleted the file to see wat happen so far everything been stable as of today...i was going every where looking to see what hack caused the problem i later found out the only one will be this hack... :ermm: :rolleyes:

Boofo 11-29-2005 02:42 PM

Quote:

Originally Posted by nievesidenshop
hey boofo that's the problem i was having i deleted the file to see wat happen so far everything been stable as of today...i was going every where looking to see what hack caused the problem i later found out the only one will be this hack... :ermm: :rolleyes:

What file did you delete?

puertoblack2003 11-29-2005 02:46 PM

Quote:

Originally Posted by Boofo
What file did you delete?

the installation file server.php and xml

Boofo 11-29-2005 02:48 PM

Quote:

Originally Posted by nievesidenshop
the installation file server.php and xml

Ok, thanks and hopefully someone can come up with a reason why this is happening and a possible fix for it. I really like this hack. :(

puertoblack2003 11-29-2005 02:52 PM

Quote:

Originally Posted by Boofo
Ok, thanks and hopefully someone can come up with a reason why this is happening and a possible fix for it. I really like this hack. :(

yes sir, i myself like it hope they fix it as well... :rolleyes:

Diana Notacat 12-12-2005 08:10 PM

Just bumping to see if anyone has found out about that server load problem yet! This hack would be wonderfully useful! :D

AWI 12-21-2005 12:36 PM

Installed on 3.5.2 and all is good. Thanks

kabir 04-19-2010 12:25 PM

Fatal error: Call to undefined function rpm_print_stop_back() in /home/mygsmbd/public_html/admincp/server_info.php on line 17

whats problem

Dream 04-20-2010 02:27 AM

I still use this on vb 4 with no problems.


All times are GMT. The time now is 05:45 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.01236 seconds
  • Memory Usage 1,772KB
  • 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
  • (3)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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