View Full Version : Server Load - On ForumHome (*nix only)
Farjad
05-19-2006, 10:00 PM
This is my first mod for vb.
a simple hack that shows server load on forumhome...
It only shows total server load in percent. ;)
enjoy & click install :)
Note: Only works on *nix
P.S. works with vB 3.5.3 & 3.5.4 (tested on both) no editing just upload product in admincp & upload images
Make sure you click install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=116134)
Updates:
Fixed Plugin (Was using global_start now using forumhome_complete)
Viewable by Admins only...
Viewable by SMods & Admins only...
Viewable by All Users...
Ahsin1
05-20-2006, 03:44 AM
thanks farjad installed
coolnikin
05-20-2006, 03:46 AM
Nice hack , installed :)
AKapadia
05-20-2006, 04:06 AM
Installed :)
Inferno Dragon
05-20-2006, 04:40 AM
Nice small hack man..I will give it a try :)
Kaleem
05-20-2006, 04:57 AM
hmmm gr8 work
tamborinegal
05-20-2006, 05:20 AM
Thanks. :) very cool.
Clancy
Allan
05-20-2006, 06:26 AM
Nice idea ;)
show just for admin ?
No show to everyone...Bad idea this..its not possible to make just for admin??
or with option to select who can see the server load..
INSTALLED
wizardan
05-20-2006, 07:17 AM
Would love to be able to turn it on and off, or restrict it to admin view only.
Nice hack:)
Installed.
projectego
05-20-2006, 07:27 AM
Nice hack, should come in useful... Cheers. ;)
FreshFroot
05-20-2006, 07:29 AM
I agree admin view will be better :)
Rickie3
05-20-2006, 08:20 AM
*installed* where does this actually get the server load stats from?
Would love to be able to turn it on and off, or restrict it to admin view only.
Nice hack:)
Installed.
Installed. Would love to see that.
Snake
05-20-2006, 09:28 AM
Thanks for releasing this hack! :)
Delphiprogrammi
05-20-2006, 10:03 AM
nice nice i love this
/me clicked install
If you want this to only be visible by the admins, do this:
Install the modification and then open the "forumhome_serverload" template.
At the very top of the template add:
<if condition="$bbuserinfo[usergroupid] == 6">
Change the 6 to reflect your admins usergroup. It is 6 by default.
At the very bottom of the template add:
</if>
Now if you are an admin, you will se it and if you are not, you won't. You can add additional usergroups by adding a comma after the 6 and adding their usergroup.
(I didn't click install because i didn't install this. I just downloaded it to see what you named the template. lol)
wizardan
05-20-2006, 01:33 PM
Thanks for the tip, Rich.
problem solved:)
Delphiprogrammi
05-20-2006, 01:43 PM
you can allow this for multiple usergroups if you want .....
<if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7)">
at the bottom
</if>
5 , 6 , 7 are usergroup id's
5 = supermods
6= Admins
7=mods
:banana:
Farjad
05-20-2006, 02:09 PM
Would love to be able to turn it on and off, or restrict it to admin view only.
Nice hack:)
Installed.
check first post :)!
Farjad
05-20-2006, 02:11 PM
you can allow this for multiple usergroups if you want .....
<if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7)">
at the bottom
</if>
5 , 6 , 7 are usergroup id's
5 = supermods
6= Admins
7=mods
:banana:
lol i also got one which works
at top add
<if condition="($bbuserinfo[usergroupid] == 6) || ($bbuserinfo[usergroupid] == 5) || ($bbuserinfo[usergroupid] == 7)">
I pyt this codes to hide from members byt nothing... :( its still there
Farjad
05-20-2006, 02:38 PM
I pyt this codes to hide from members byt nothing... :( its still there
are you logged in as an admin ?? if you are then logout !
are you logged in as an admin ?? if you are then logout !
im login with my test user account...and both of account admin and normal user can see it
Tulsa
05-20-2006, 02:54 PM
Very nicely done. :)
Total server load based on what though?
Farjad
05-20-2006, 03:10 PM
Well its based on the system info, as its using min(100, round(exec('ps ax | grep -c apache') / 256 * 100))
Farjad
05-20-2006, 03:35 PM
im login with my test user account...and both of account admin and normal user can see it
alright got it I edited the plugin and made few changes if you want for Admin download the zip for only admins!
melefire
05-20-2006, 03:41 PM
Awsome man,
*melefire clicks install
sudn3sc3d
05-20-2006, 03:58 PM
good job dude.
alright got it I edited the plugin and made few changes if you want for Admin download the zip for only admins!
DONE ;) Good job.
Robert Basil
05-20-2006, 05:15 PM
You should also state that this only runs under *nix
Farjad
05-20-2006, 06:17 PM
You should also state that this only runs under *nix
hmm... i didnt know that well let me do that now... thnx!
Qwest
05-20-2006, 06:17 PM
Well done. Installed.
Ramsesx
05-20-2006, 06:40 PM
Stupid question but what means "*nix"?
B.t.w. would be cool if there's a way to put this into the footer same as in the attached screenshot.
Farjad
05-20-2006, 07:21 PM
Stupid question but what means "*nix"?
B.t.w. would be cool if there's a way to put this into the footer same as in the attached screenshot.
well would u want that globally or what ?? i can try as it wouldnt be too difficult ...
*nix = Linux based systems...
Ramsesx
05-20-2006, 07:41 PM
For admin only would be nice, thanks for your effort.
icare
05-20-2006, 07:52 PM
<font color="YellowGreen">**Installed**</font>
tHANK YOU
Farjad
05-20-2006, 07:54 PM
For admin only would be nice, thanks for your effort.
well ill try to make it, but i have made one for header if you would like that it will require template edit though...
Ramsesx
05-20-2006, 08:22 PM
well ill try to make it, but i have made one for header if you would like that it will require template edit though...
If you have it already for the header I think can put the code as it is into the footer?
Ghanem
05-20-2006, 09:43 PM
Hi,
Thank you for the nice hack
its working fine for me, but does not lool good even with the original style..
Have a look at the attachment plz..
Farjad
05-20-2006, 10:15 PM
Hi,
Thank you for the nice hack
its working fine for me, but does not lool good even with the original style..
Have a look at the attachment plz..
PM me your site url ill take a look...
Ghanem
05-20-2006, 10:29 PM
Thank you for your fast reply
Click my name then choose visit Ghanem..
I have changed it from left to right and added align=middle only
With out it, it will look like the attachment
Farjad
05-20-2006, 11:45 PM
Thank you for your fast reply
Click my name then choose visit Ghanem..
I have changed it from left to right and added align=middle only
With out it, it will look like the attachment
well, the prob is I am assuming you installed Admin only mod , so I do not know, lol and also your language that you are using is left to right so i guess thats the reason itsnot right.
Ghanem
05-21-2006, 12:14 AM
..
The first screen shot was before I install the admin and super
The second was after, in addition, its with the original style
I wish thats the reason cos in that case it would be solved, but its not..
The following link is using the English language using the original style, still does not look correct..
http://www.la7odood.com/vb/index.php?langid=1&styleid=10
Regards
scottct1
05-21-2006, 12:47 AM
I installed this but not sure if its accurate, I am running a Dual CPU Dual Core system (It looks like I have 4 CPU's in my server), and my server load is only 0.59 and this mod is reporting that my server load is 30%.
Is this accurate?
Guest210212002
05-21-2006, 02:47 AM
/me clicks install
Dual CPU VPS system, 40 people online, and my server load says 1%. Seems way low though.
scottct1
05-21-2006, 02:54 AM
I have 1570 people online, in top my server load is .059 and it says my server load is 25%. Again I have a server with 4 CPU's, so I dont think this is measuring correctly in a multi processor enviroment.
Rickie3
05-21-2006, 03:22 AM
i installed this yesterday then applied the update today,and its still reading zero on my board maybe it doesnt work for 3.5.0??
Farjad
05-21-2006, 04:13 AM
i installed this yesterday then applied the update today,and its still reading zero on my board maybe it doesnt work for 3.5.0??
Are you using Windows or Linux ?
Rickie3
05-21-2006, 04:25 AM
Are you using Windows or Linux ?linux
FreshFroot
05-21-2006, 04:29 AM
same here I get a error at the top saying something about the index.php.....
Total666
05-21-2006, 04:42 AM
I clicked install , where do I upload the images too ?? This looks great , thanks , I imported the mod for admins / super mods - I logged back in as a reg user , it is still visable ... Help .. .. Total
A_N_K_A_R_A
05-21-2006, 06:55 AM
allusers nice thanks
PabloAM
05-21-2006, 02:22 PM
ONE ERROR!!! :(
Warning: exec() has been disabled for security reasons in /foro.php(471) : eval()'d code on line 505
helpme please!
Delphiprogrammi
05-21-2006, 02:43 PM
ONE ERROR!!! :(
Warning: exec() has been disabled for security reasons in /foro.php(471) : eval()'d code on line 505
helpme please!
Your host has disabled the exec(); functions nothing todo about that ....
Delphiprogrammi
05-21-2006, 04:19 PM
Why not Windows ?
because ps is a unix function windows doesn't know it
ps ax | grep -c apache
who uses a windows server to host there sites anyway only crazy people do
so the server should be UNIX to get this work, not my computer, am I right ?
Total666
05-21-2006, 06:26 PM
so the server should be UNIX to get this work, not my computer, am I right ?
Yes , the server , not your computer ...
i installed this yesterday then applied the update today,and its still reading zero on my board maybe it doesnt work for 3.5.0??
the same here then but mine is 3.5.4.
SpaceStar
05-21-2006, 09:39 PM
Excellent - installed
Rickie3
05-21-2006, 09:49 PM
mine is still stuck on 0 no change at all since install
utw-Mephisto
05-21-2006, 10:13 PM
I would install it when I also can move it to the footer ... I would not mind template edits, but since this information is hardly needed on daily basis it would be better not to have it that obvious .. just my .02 cent
Mr Chad
05-22-2006, 04:38 AM
worked fine :)
titodj
05-22-2006, 07:17 AM
Nice.. Thanks...
SkyCatcher
05-22-2006, 04:51 PM
It doesn't work on my forum :(
It always stays at 0.
I ran "ps ax | grep -c apache" and it said 14 and when I checked the forum it was at 0 again so somehow it's not getting results
jwocky
05-23-2006, 01:56 AM
Does this work on FreeBSD ? I love the idea and look of this hack, but it stays at either 0% or 1% on my forum, so i'm assuming it doenst work for freebsd ?
firstrebel
05-23-2006, 07:44 AM
Very useful, saves loggin in with SSH all the time. *clicks install*
Bob
SkyCatcher
05-23-2006, 08:20 AM
Does this work on FreeBSD ? I love the idea and look of this hack, but it stays at either 0% or 1% on my forum, so i'm assuming it doenst work for freebsd ?
I'm using SuSE10 and it's not working...
I tried both ps ax | grep -c apache and ps ax | grep -c apache2 since SuSE 10 doesn't seem to respond well to apache and neither of them forum for the forum.
Both work in ssh.
Is there anything I have setup on my server to prevent the command from being executed? I mean, basically you're executing shell commands from php which makes me a little bit nervous.
Aeolian
05-23-2006, 10:36 AM
isn't it server intensive to do top all the time.. considering you have a large forum..??
plz confirm..
firstrebel
05-23-2006, 01:45 PM
Jut put it on the admin login page. No real need for anyone else to have this.
Bob
bashy
05-23-2006, 07:23 PM
Hi
Mine says 1% and has done since installing this (as soon as it came out)
My server load is no less that 4% for the last few days....
What would cause this not to work properly please?
Guest210212002
05-24-2006, 10:41 PM
Hi
Mine says 1% and has done since installing this (as soon as it came out)
My server load is no less that 4% for the last few days....
What would cause this not to work properly please?
Same here.
Nachtfalke
06-04-2006, 08:22 PM
Your host has disabled the exec(); functions nothing todo about that ....
...seems that my hoster has done this today. Everything went fine since the day I installed the hack, but today I got the message "exec, phpinfo, popen, proc_open() has been disabled for security reasons"
It's a pitty, I loved this hack.
DrHUS
09-17-2006, 04:29 PM
3.6.1 worked fine .. Thank you
nerofix
09-17-2006, 07:23 PM
I get following message by trying to uninstall the mod:
- 210th SECURITY ALERT -
The Board Security System has detected, that you wanted to bring bad
Code to this Forum or you have tried to exploit something here or maybe
another attack linke this.
This attempt was blocked and we logged all information about this.
If you see this message after including a new MOD to your Forum or if
you have reached this site over a normal Forum Link, please contact
the Board Administrator to fix this Problem.
CBACK CrackerTracker
ShellingFox
09-19-2006, 04:32 AM
Installed :)
Nice mods
Cagonni
10-18-2006, 04:10 AM
it worked but is it possible to show %0.xx ?
it begins from %1 and i suppose it shows only integers.Is it possible to show decimal numbers?
installed.
SCRIPT3R
10-18-2006, 05:47 PM
i've edited the image to stats, to more accurately reflect it's purpose (IMO)...
img src="$stylevar[imgdir_misc]/stats.gif"
also, would like to appear beneath the statistics instead atop, any suggestion?
SCRIPT3R
10-18-2006, 06:25 PM
Re: *nix...
this should show the average server load and server uptime in days.
$uptime = @exec('uptime');
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$uptime,$avgs);
$uptime = explode(' up ', $uptime);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].', '.$uptime[1];
$start=mktime(0, 0, 0, 1, 1, date("Y"), 0);
$end=mktime(0, 0, 0, date("m"), date("j"), date("y"), 0);
$diff=$end-$start;
$days=$diff/86400;
$percentage=($uptime/$days) * 100;
$load=$avgs[1].",".$avgs[2].",".$avgs[3]."";
echo 'Average Load: '.$load;
echo 'Uptime: '.$uptime;
Silver_2000_)!
12-01-2006, 12:57 PM
Sorta strange
Single processor server running at load of 1.2 ( which is HIGH ) and this hack shows it as 13 %
I guess its assuming a load of 10 is 100% ...
Its also visible to all users even though I used the Supermods and admins version
seems this mod works fine to limit acces though
https://vborg.vbsupport.ru/showpost.php?p=982031&postcount=19
MrPHD
12-02-2006, 12:21 PM
Installed and nice job.
Cybershaolin
12-03-2006, 04:12 AM
Will this wok with 3.6.4 or could it be upgraded?
Installed on vb3.6.0
But its showing 0% all the time.
Cybershaolin
12-06-2006, 11:52 AM
Then, it would be nice if this hack be upgraded to 3.6.X.
Cybershaolin
12-10-2006, 07:47 PM
Anyone?
orban
12-17-2006, 10:21 AM
$serverload_percent = min(100, round(exec('ps ax | grep -c apache') / 256 * 100));
What does this calculate? The number of Apache processes divided by 256?
lanc3lot
12-29-2006, 01:57 PM
Can this be changed so it can be used with v3.6?
justachump
01-13-2007, 01:53 AM
Installed on vb3.6.0
But its showing 0% all the time.
I am on vb3.6.4 and i got zero all the time too,, and im on linux server
justachump
01-13-2007, 03:21 PM
Anyone?
:confused:
SEYTAN_NL
01-14-2007, 10:51 AM
i installed this yesterday then applied the update today,and its still reading zero on my board maybe it doesnt work for 3.5.0??
The same with 3.5.4. & 3.6.2
AMG021
01-22-2007, 03:05 AM
Can someone please port this hack to 3.6? because i get 0% all the time. And im on linux server
Cybershaolin
02-13-2007, 06:45 PM
OK mine was working but suddenly it now sticks at 29% with or without traffic. What could cause that?
Could that be anything with the file permissions (attributes) on the server or with a service not activated.
My ISP re-installed the control panel after a crash. He brought the forum back online before re-installing the control panel. It's not working since that time (well, it's jammed at 29% like I said).
fatal1980
03-04-2007, 06:39 PM
I'm using VB 3.6.4
It shows 1% regardless if my server load is 0.01 or 15.0
Any ideas?
Cybershaolin
03-20-2007, 01:29 AM
Just too bad this one is not supported anymore. Is there a similar mod? Not the ones I saw that shows some info differently but one with a colored bars like this...
benjaminbih
07-02-2007, 07:49 PM
works graet on 3.6.7, thnx
Total666
07-02-2007, 09:34 PM
works graet on 3.6.7, thnx
So it is working on your 3.67 ??? Really ???? ..
Total666
08-05-2007, 02:19 AM
So it is working on your 3.67 ??? Really ???? ..
BUMP --- Anyone have this working on 3.68 ??
jshg46
08-19-2007, 03:53 PM
on vbulletin 3.6.8 this is how i made it work. instead of putting serverload images in the images directory just ftp the folder called serverload directly to the root, works like a charm
so im other word you should have the folder serverload in your forum root not inside the folder images.
Cybershaolin
02-13-2008, 11:50 PM
Yes I have it working for 3.6.8 here without havin to put the server load directory in the root...
But the problem is that the bar is always green no matter how the load is.
With a server load showing at 20, I tried changing the values to something smaller in order to check if the bar would turns yellow but nothing. Made quite a few refresh screens but nothing?
Anybody has a clue? Maybe the conditions are uncorrect?
This is what I tried:
global $vbulletin;
if($vbulletin->userinfo['usergroupid'] == '5' OR ($vbulletin->userinfo['usergroupid'] == '6' OR ($vbulletin->userinfo['usergroupid'] == '7' OR ($vbulletin->userinfo['usergroupid'] == '9' OR ($vbulletin->userinfo['usergroupid'] == '13'))))) {
$serverload_percent = min(100, round(exec('ps ax | grep -c apache') / 256 * 100));
$serverload_top = "<table border=0 width=402><tr><td align='left' height='0' width=402 style='border: #000000 1px solid; background-repeat: repeat-x'>";
if ($percent <= 30) $serverload_img = "loadbargreen.gif";
elseif ($serverload_percent <= 70) $serverload_img = "loadbaryellow.gif";
else $serverload_img = "loadbarred.gif";
$serverload_width = $serverload_percent * 4;
$serverload_bottom = "</td></tr></table>";
$search_text = '<!-- end logged-in users -->';
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,
$search_text.fetch_template('forumhome_serverload' ),$vbulletin->templatecache['FORUMHOME']);
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.