View Full Version : Administrative and Maintenance Tools - Server Info in Admin Control Panel
Dream
11-06-2006, 10:00 PM
This is a script that shows a lot of server information inside the AdminCP.
- Shows server time with exec(date)
- Shows uptime with exec(uptime)
- Shows server load with file_get_contents("/proc/loadavg")
- Shows memory usage with exec(free -m)
- Shows free disk space with exec(df -h)
- 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"
Info on Server Loads (http://www.vbulletin.com/forum/showthread.php?action=showpost&postid=291831)
voteforbird
11-07-2006, 04:52 AM
Screenshot?
Feckie (Roger)
11-07-2006, 05:09 AM
Installed and working............:)
lighter
11-07-2006, 06:40 AM
Would appreciate for a screen shot.
Snake
11-07-2006, 09:09 AM
Yep I'd love to see a screenshot, please. :)
redspider
11-07-2006, 03:09 PM
here some screenshot
redspider
11-07-2006, 03:10 PM
more screenshot
redspider
11-07-2006, 03:10 PM
some more
redspider
11-07-2006, 03:12 PM
last screenshot
this was Installed in dtv100.com and working good thanks
transitbus
11-07-2006, 03:41 PM
Works great except I can not access memory information. This is nothing to do with this mod but instead locking of the server form displaying this info to shmucks like me.
Dream
11-07-2006, 08:39 PM
Thanks Redspider :)
TexasDreams
11-07-2006, 11:17 PM
Works great except I can not access memory information. This is nothing to do with this mod but instead locking of the server form displaying this info to shmucks like me.
I wasn't getting the "Memory Usage" display either, because my server is on FreeBSD instead of Linux.
So, in "server_info.php" I changed lines 58 through 63...
FROM (Linux using 'free')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free)</span>');
exec('free', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
TO (FreeBSD using 'vmstat')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(vmstat)</span>');
exec('vmstat', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
Works in a pinch to give the same kind of info. :)
Chad F.
11-08-2006, 03:21 AM
Is this secure or is there vulnrabilites with it?
Guest210212002
11-12-2006, 01:05 PM
Very slick. Can you add the output from plain old uptime as well?
/me clicks install
Dream
11-12-2006, 05:26 PM
Sure, whats the unix command for that?
transitbus
11-12-2006, 05:45 PM
I wasn't getting the "Memory Usage" display either, because my server is on FreeBSD instead of Linux.
So, in "server_info.php" I changed lines 58 through 63...
FROM (Linux using 'free')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free)</span>');
exec('free', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
TO (FreeBSD using 'vmstat')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(vmstat)</span>');
exec('vmstat', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
Works in a pinch to give the same kind of info. :)
LOL didn't even think of this one. Much thanks for it :D
adwade
11-17-2006, 12:39 AM
This is a really neat tool, lots of info all in one place.:D One question though, being BRAND NEW to all this I'm still learning the ropes of vB adminstration.
How do others know or track simple things like available disk space, or memory on their server?
Is that just a (daily) manual process wherein you look at it, or are there automated tools to forewarn you of an impending disaster?(i.e. emailed alert to admin, etc)
Does cPanel (or anything else) have those kind of features? Are there other MODs out there that admins typically use to keep an eye out about such things? Or does your HOST warn you when you come to close to the edge? Etc. Thanxx!
da420
11-30-2006, 06:49 AM
/me installs
pedroenf
12-05-2006, 12:35 AM
Could this mod work in windows 2003 sever? Thanks.
it works with vb3.6.4 and all types of server?
is there any way to show cpu uses stats ?
Cybershaolin
02-13-2007, 05:22 AM
Sorry wrong thread. Delte please.
Dream
03-16-2007, 02:54 PM
Updated, added uptime
adwade
03-16-2007, 03:09 PM
Updated, added uptime
Just went to update after FTP'ing the file to my Admincp directory and during the Import/Overwrite got: "Invalid File Specified" Checked and rechecked using the browse funtion and it show up, but won't IMPORT. Is the xml file ok?
Dream
03-16-2007, 03:11 PM
Don't import the xml, upload it to includes/xml
adwade
03-16-2007, 03:13 PM
Ah ha! No wonder it wouldn't work. Sorry-so-slow. Thanxx for the help, works fine when you follow the directions! ha, ha
As so clearly stated above:
Installation
- Upload "server_info.php" to your admincp
- Upload "cpnav_serverinfo.xml" to your includes/xml
- Reload your AdminCP, its under "Server Info"
Dream
03-16-2007, 03:30 PM
No problem :)
daddygrim
03-18-2007, 11:00 PM
looking good!!!
bluechris
03-24-2007, 08:40 AM
Nothing works for 2k3 servers and IIS... only mysql info :(
Dream
03-24-2007, 02:41 PM
Yes this mod is meant for Unix, sorry.
If anyone wants to use this as a base for a Win version be my guest.
Doctor Death
03-24-2007, 06:31 PM
Installed.
Not sure why you need individual menu items when you have the ALL option...
Nice mod... Will be looking forward to next version.
Isn't there the ability to import as a product?
Server Info will not show up as product now and therefore you cannot track versions installed.
Thanks
jw00dy
03-26-2007, 01:35 AM
Great mod.
I made some modifications to mine so it would show the free and df information is easier to read formats.
free -m show the memory in MB and not kb.
df -h show the stats in MB, GB, etc.
Both are much easier to read. And feel free to update the mod so it shows them this way, as I think most will prefer it this way.
Lines 66 - 80 in server_info.php changed to this:
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free -m)</span>');
exec('free -m', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
}
if ($_REQUEST['show'] == 'freediskspace' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Free Disk Space <span class="normal">exec(df -h)</span>');
exec('df -h', $df);
print_description_row('<pre>'.implode('<br />', $df).'</pre>');
print_table_footer();
}
Dream
03-26-2007, 01:40 AM
Thanks, I'll update the mod :)
great
jw00dy
03-26-2007, 01:43 AM
Guess some screen prints might be nice too:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda6 2.0G 473M 1.4G 26% /
/dev/hda1 99M 36M 59M 38% /boot
/dev/hda2 9.7G 1.9G 7.4G 20% /usr
/dev/hda3 7.7G 797M 6.6G 11% /var
/dev/hda7 989M 17M 922M 2% /tmp
/dev/hda8 52G 5.3G 44G 11% /home
none 1000M 0 1000M 0% /dev/shm
/dev/hdb1 46G 2.7G 41G 7% /home2
/dev/hdb3 26G 7.7G 17G 32% /backupfree -m
total used free shared buffers cached
Mem: 1999 1882 116 0 213 745
-/+ buffers/cache: 924 1075
Swap: 4000 0 4000
jw00dy
03-26-2007, 01:45 AM
Thanks, I'll update the mod :)
great
Cool, just glad to help. I can't code for jack, but in some cases I'm useful :D :D
Dream
03-26-2007, 02:31 AM
Well, I'm not a Unix guru myself :)
Updated, made free be free -m and df be df -h
Dream
03-26-2007, 02:40 AM
Server Info will not show up as product now and therefore you cannot track versions installed.
I always send an update when I update my mods. Sending an update sends an email to everyone that has the mod marked as Installed. So no need for a useless product xml just to show a version number.
adwade
03-26-2007, 11:03 AM
One question, for those of us not in-the-know (yet) what do each of the numbers mean?(i.e. Average for some timeperiod, Instantaneous, Peak, etc??)
Server Loads: average: 2.22, 2.10, 2.30 2.22 : 2.10
Also Thanxx for the tickler stating: Please click Mark as Installed if you use this modification >>>> Somehow I'd overlooked Clicking 'Installed' and it caught my attention this time. And after reading the statement just above, I understand WHY it's important to do so!:eek: Anyway, I'm on board now. :D Nice improvements too, jw00dy. :up:
mcqwert
03-26-2007, 05:08 PM
Thanks.
Also, frightening to see how high my server load is:
Server Loads: 28.07 26.97 : 29.84
Dream
03-26-2007, 10:38 PM
One question, for those of us not in-the-know (yet) what do each of the numbers mean?(i.e. Average for some timeperiod, Instantaneous, Peak, etc??)
Server Loads: average: 2.22, 2.10, 2.30 2.22 : 2.10
Also Thanxx for the tickler stating: Please click Mark as Installed if you use this modification >>>> Somehow I'd overlooked Clicking 'Installed' and it caught my attention this time. And after reading the statement just above, I understand WHY it's important to do so!:eek: Anyway, I'm on board now. :D Nice improvements too, jw00dy. :up:
Here's info on server loads that may help you
http://www.vbulletin.com/forum/showthread.php?action=showpost&postid=291831
Paul M
03-26-2007, 10:46 PM
Thanks.
Also, frightening to see how high my server load is:
Server Loads: 28.07 26.97 : 29.84
That's not just frightening, it's appalling, I honestly don't know how your forum is running - the response times from it must be poor/dire.
jw00dy
03-27-2007, 08:36 AM
Yeah, those numbers are pretty frightening...
Doctor Death
03-27-2007, 11:38 AM
I always send an update when I update my mods. Sending an update sends an email to everyone that has the mod marked as Installed. So no need for a useless product xml just to show a version number.
Well, I ask for this not just to see a number... I would like the metadata populated to support the CHECK VERSION function... I have a product that automatically does this, and many developers do this which allows immediate and automatic notification.
Thanks, great mod.
daddygrim
03-27-2007, 01:29 PM
Uptime exec(uptime)
8:19AM up 336 days, 4:48, 0 users, load averages: 0.42, 0.63, 0.67
Server Loads: averages: 0.70, 0.68, 0.69 0.70 : 0.68
Filesystem Size Used Avail Capacity Mounted on
/dev/amrd0s1a 3.9G 843M 2.7G 23% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/amrd0s1g 49G 18G 27G 40% /hsphere
/dev/amrd0s1f 1.9G 74M 1.7G 4% /tmp
/dev/amrd0s1d 4.8G 3.3G 1.2G 73% /usr
/dev/amrd0s1e 4.8G 2.2G 2.3G 48% /var
procfs 4.0K 4.0K 0B 100% /proc
linprocfs 4.0K 4.0K 0B 100% /usr/compat/linux/proc
Thanks.
Since moving to a dedicated, reading the stats are easier this way.
Gracias and Marked :)
-Mike
Hi
How can Used only server load information on the form home or footer
like this Server Loads: 2.22
if there is way i will try to install it
thanks
Dream
03-28-2007, 10:26 PM
Use this mod
https://vborg.vbsupport.ru/showthread.php?t=140449
Muellmann
03-29-2007, 05:33 PM
It works perfect thanks for this addon :)
GrendelKhan{TSU
03-30-2007, 12:28 PM
simple goodness... thanks!
<< installed
rjmjr69
04-17-2007, 06:52 AM
Thank you very nice work
Dunno012007
04-17-2007, 03:53 PM
Great Mod thanks
BadgerDog
04-17-2007, 07:57 PM
Installed....
Reloaded AdminCP and logged in...
Run any function and get this...
Fatal error: Call to undefined function rpm_print_stop_back() in /usr/www/apache/htdocs/milsurps/admincp/server_info.php on line 17
Suggestions?
Thanks
Regards,
Badger
Edit: Ignore above... discovered you had to be logged in as SuperAdmin.... :)
I usually avoid that and only login as Admin.... can I change something someplace to be able to use it under the lower capability?
BTW, here's what I get for loading...
16:57:51 up 194 days, 20:26, 0 users, load average: 0.08, 0.03, 0.01
Use this mod
https://vborg.vbsupport.ru/showthread.php?t=140449
thanks a lot Dream :up:
NeRilkA
04-21-2007, 04:17 PM
Thanks Dream :)
I'm testing it for the translation but Uptime is empty and Server Loads said Failed (i didn't translate these lines ;))
And on another forum I got this error with the original file :
Fatal error: Call to undefined function rpm_print_stop_back() in /home/www/***/web/forum/admincp/server_info.php on line 17
Oh i just thought it may be because this other forum is on 3.6.4 ?
Dotara
04-21-2007, 06:41 PM
FROM (Linux using 'free')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free)</span>');
exec('free', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
TO (FreeBSD using 'vmstat')
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(vmstat)</span>');
exec('vmstat', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
After replacing these codes for freebsd, I'm getting error "parse error: syntax error, unexpected $end in /usr/home/dotara/public_html/admincp/server_info.php 152"
:confused:
I'm using FreeBSD 6.x
Dream
04-21-2007, 06:48 PM
Thanks Dream :)
I'm testing it for the translation but Uptime is empty and Server Loads said Failed (i didn't translate these lines ;))
And on another forum I got this error with the original file :
Oh i just thought it may be because this other forum is on 3.6.4 ?
Are you running on unix?
The other problem you have is my bad. You need to run this as a Super Admin or that will happen.
Dream
04-21-2007, 06:49 PM
After replacing these codes for freebsd, I'm getting error "parse error: syntax error, unexpected $end in /usr/home/dotara/public_html/admincp/server_info.php 152"
:confused:
I'm using FreeBSD 6.x
Most likely an error in your editing the file, thats a PHP parse error. Check line 152 of the file.
Dotara
04-21-2007, 06:53 PM
Most likely an error in your editing the file, thats a PHP parse error. Check line 152 of the file.
Here is Line 152 ?>
I've only replaced the codes of memory usage, didn't edit anything else.
Dream
04-21-2007, 06:54 PM
Attach your modified serverinfo.php
Dotara
04-21-2007, 06:56 PM
Attached.
Dream
04-21-2007, 06:59 PM
I think you ate a } after
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free)</span>');
exec('vmstat', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
Dotara
04-21-2007, 07:10 PM
I think you ate a } after
if ($_REQUEST['show'] == 'memoryusage' || empty($_REQUEST['show'])) {
print_form_header('', '');
print_table_header('Memory Usage <span class="normal">exec(free)</span>');
exec('vmstat', $mem);
print_description_row('<pre>'.implode('<br />', $mem).'</pre>');
print_table_footer();
No! I made the mistake in "free" on line 4 where I should put vmstat. I only placed vmstat once instead of twice. Sorry. Now it's working fine :)
I clicked "Mark as Installed"
BadgerDog
04-21-2007, 07:40 PM
Installed....
I usually avoid that and only login as Admin.... can I change something someplace to be able to use it under the lower capability?
BTW, here's what I get for loading...
16:57:51 up 194 days, 20:26, 0 users, load average: 0.08, 0.03, 0.01
Dream....
Any advice on what to change so I can use this just as an Admin?
Thanks
Regards,
Badger
NeRilkA
04-21-2007, 10:29 PM
Are you running on unix?
The other problem you have is my bad. You need to run this as a Super Admin or that will happen.
I suppose its unix because the os is linux ;)
I'm sorry I forgot about the Superadmin when i was testing it on the other forum :erm: :p
Dream
04-22-2007, 12:32 AM
Dream....
Any advice on what to change so I can use this just as an Admin?
Thanks
Regards,
Badger
remove this from server_info.php
// ########################## SUPERADMIN CHECK ############################
if (!in_array($vbulletin->userinfo['userid'], preg_split('#\s*,\s*#s', $vbulletin->config['SpecialUsers']['superadministrators'], -1, PREG_SPLIT_NO_EMPTY)) ) {
rpm_print_stop_back("You don't have permission to access this page.");
}
Nerilka, I'm sorry but I don't know why uptime isn't working for you. Do you have access to the server? You could try using uptime in the command line and see if your unix system has this command.
NeRilkA
04-22-2007, 03:08 PM
It doesn't really matter for the uptime, i don't have access to the server anyway
is it the same problem for Server Loads failed ?
thanks for your time :)
Dream
05-05-2007, 09:49 PM
Not sure, sorry. I'm not very familiar with Unix commands, I just borrowed some codes from other places to wrap this up for me.
kelekian
05-06-2007, 05:15 AM
server time, uptime, memory usage, free disk space, is coming as blank... :S
someone knows this problem?
jw00dy
05-06-2007, 09:08 PM
Are you on a dedicated server? If you are not, then it's very very possible this will not work for you. If you are simply leasing some space from someone then it's more then likely that it won't work. It all depends on how they have you setup.
Dream
05-06-2007, 09:12 PM
Also your exec() PHP function could be disabled by your host.
kelekian
05-07-2007, 02:19 PM
Are you on a dedicated server? If you are not, then it's very very possible this will not work for you. If you are simply leasing some space from someone then it's more then likely that it won't work. It all depends on how they have you setup.
semi-dedicated server...
jw00dy
05-07-2007, 06:48 PM
semi meaning it's not your server and you lease space from someone else.
What dream mentioned is probably exactly the problem.
perfphysio
05-13-2007, 12:16 PM
I have a few errors following this installl on 3.6.6. They are below. Is this due perhaps to me running a VPS system?
Warning: exec() [function.exec]: Unable to fork [date] in \admincp\server_info.php on line 33
Warning: exec() [function.exec]: Unable to fork [uptime] in \admincp\server_info.php on line 41
Warning: exec() [function.exec]: Unable to fork [free -m] in \admincp\server_info.php on line 69
Warning: exec() [function.exec]: Unable to fork [df -h] in \admincp\server_info.php on line 77
jw00dy
05-24-2007, 01:57 AM
Yes, looks like the php functions are not allowed to be ran on your VPS.
Nice thank you
Install click
Ymy
.
zooro
06-29-2007, 10:28 AM
it seems that its not work on 3.6.7 pl !
cannot import or upload
any suggestions ?
Dream
06-29-2007, 06:48 PM
You don't import the xml, read the installation instructions again.
quiklink
07-02-2007, 02:02 AM
Nice mod! But is there any way to have it give a notice like 'You must be a super-admin to use these functions' instead of the error it throws? The current check can't find rpm_print_stop_back
Delphiprogrammi
07-02-2007, 09:43 PM
nice one verry nice
SuperTaz
07-03-2007, 04:18 AM
Very nice. installed.
Carlos2
07-18-2007, 09:15 AM
With this plugin can you see the CPU memory consume??
ShMilO
07-01-2008, 03:54 PM
gives me an error each time
Warning: exec() has been disabled for security reasons in /admincp/server_info.php on line 41
what should i do
Dream
07-02-2008, 12:11 AM
ask your host to enable exec on your server, or else this mod wont work
Scandal
07-25-2008, 12:01 PM
Installed!
-petros
Scandal
07-27-2008, 12:07 PM
It doesn't work on vBulletin 3.7.2 :(
-petros
redspider
07-27-2008, 03:57 PM
It doesn't work on vBulletin 3.7.2 :(
-petros
is working for me 3.7.2
Mrdby
10-01-2008, 10:39 PM
mine is still working..but is now pointless anyway...why even have this mod? uninstall.
terminator2k2
04-05-2009, 10:09 PM
does it work on vb 3.7.6 and 3.8.x?
Dream
04-06-2009, 12:23 AM
yes
Gio Takahashi
04-28-2009, 03:41 PM
so when I attempt to install this, it gives me "invalid file specified" through product.
Dream
04-28-2009, 09:53 PM
you dont import files, just upload
michael24179
04-26-2010, 09:30 AM
I get the following error status MSQL
Warnung: mysql_stat(): Access denied for user 'DEB'@'localhost' (using password: NO) in [path]/admincp/server_info.php (Zeile 119)
Warnung: mysql_stat(): A link to the server could not be established in [path]/admincp/server_info.php (Zeile 119)
What do I have here to view these statistics
Dream
04-26-2010, 10:24 PM
you should talk to your host about this issue.
peter_trucker
04-28-2010, 10:51 AM
installed and works good in vb3.8.5 also :D
wangyu1314
07-03-2010, 07:22 AM
Warning: mysql_stat() [function.mysql-stat]: Access denied for user 'www'@'localhost' (using password: NO) in /admincp/server_info.php on line 119
Warning: mysql_stat() [function.mysql-stat]: A link to the server could not be established in /admincp/server_info.php on line 119
why?
OldSchoolDSL
11-23-2010, 03:00 PM
Tested & working on 4.0.8 (Patch Level 2)
ZERO <ibis>
02-21-2011, 05:57 PM
Still works even with latest 4.1.2!
OldSchoolDSL
11-19-2011, 04:45 AM
Shocking that this works in 4.1.8
JesWhite
02-15-2016, 04:05 AM
great...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.