PDA

View Full Version : My 1st hack :) Server Health


over
18 Nov 2001, 19:03
Tested on various *nix servers

Description, shows you some important details of your server, the current time, uptime, amount of users that are telneted/ssh'd into your box, the load average, number of proecesses and some information about them, memory usuage and also the swap file usage. ie displays "top" information.

Anything above a load average of more than 5 you should try to find out whats taking up the resources.
above 10 your server will be running slow as hell.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Download The Attachment, which contains the file, required servstats.php and also a copy of these instructions :)

Edit the Following Vars To Suit Your Needs.


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


you can find them on lines 6 and 7.

Upload to {vbportalpath}/{forums dir}/{admin dir}

Edit the index.php in your main forum admin directory as follows (eg /{path to vbportal}/{forum path}/{vbb admin path}/index.php)

Find code


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Below that add



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Upload the edited file to /{vbb dir}/{forums dir}/{admin dir}/
The above will give you a sub menu in your vbb's main admin panel.

(all done if just using vbb 2.2.x)

Goto your portal admin area (eg http://127.0.0.1/vbportal/admin.php
Choose side blocks (eg http://127.0.0.1/vbportal/admin.php?op=AdvBlocksAdmin)
Edit the Administration Block (eg http://127.0.0.1/vbportal/admin.php?op=AdvBlocksEdit&bid=15)

Find:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Under that add:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


The above will only let admins able to click the link to the server health directly from the admin menu
on the Administration Sideblock, no others will be able to see it.

Open /{pathtovbportal}/admin.php
Find:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Under that add



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Above gives you a link in your vbportal admin area

All done :)


If yo have a different forums or vbb admin path please change the directories appropriately for the above instructions.

Sorry if theirs better ways of doing this, but im new at trying, and trying is what counts?
Hope you find it useful.

You can also change the name of servstats.php to what you desire, if you do please remember to change all occurances of
servstats.php in all occurances in these intructions.
For support check www.phpportals.com

over
18 Nov 2001, 20:11
i'll add hd space, used, left to it, i'll try also to make it so that you can fill in the space allocated so it calc's the value from that at some point in future :)

LDT
18 Nov 2001, 20:30
Gotta give this a try. :)

LDT
18 Nov 2001, 20:44
Upload to {vbportalpath}/{forums dir}/{admin dir}

Uhm, there already is a stats.php there... I don't think I'm supposed to replace that?

over
18 Nov 2001, 21:01
Originally posted by LDT

Uhm, there already is a stats.php there... I don't think I'm supposed to replace that?

nope, call it something else.


updated the instuctions and attachment soz for that :)

TheComputerGuy
19 Nov 2001, 00:28
I will try it out tonight or tommrow

LDT
19 Nov 2001, 16:07
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Any ideas?

LDT
19 Nov 2001, 16:16
OK, got it now... you should check the php file in the zip file, it seems to be pretty messed up... Many things are in the same line... Which doesn't really matter until it hits this line:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I also think it's better to add


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


right before


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



If you want to leave i that way however you should remove ,"|" from


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


so that it looks like this


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


as it isn't needed.

over
19 Nov 2001, 18:37
i prolly uploaded my old file, i'll correct that when im back home :)
adding the menu under vbb's own stats is prolly a better idea, didn't think of that thanks, got a new version to upload neway :) which also states space left (option to input drive space allocated) and the space used in that directory.

LDT
19 Nov 2001, 19:19
Great, I'll be waiting. :)

over
20 Nov 2001, 20:14
fixing a couple of issues with the disc space addition, not forgotten to update, doesnt work properly yet.

Cruz
26 Nov 2001, 02:00
after getting many many parse errors, i got it working....here is the new file:

exodus
09 Dec 2001, 00:43
you may want to add the "httpd" processes cpu utilization.

Jawelin
02 Feb 2002, 23:39
This hack worked well for more than a month. Now, suddendly, it stopped without changing anything on my server or on servstats.php ????
Still using vb 2.2.1 ...

Actually I get - now, for example, an html page containing only:
<body><pre>

Sat Feb 2 18:40:22 EST 2002

</pre></body></html>

Bah ?!?

haas
07 Feb 2002, 05:37
Uhmmm. Seems very good.... I'll install it when I get a *nix box for the board.

Jawelin
09 Feb 2002, 10:27
Originally posted by Jawelin
This hack worked well for more than a month. Now, suddendly, it stopped without changing anything on my server or on servstats.php ????
Still using vb 2.2.1 ...

Any idea ???
I tried reinstalling it again and again, but !! :stupid:

X-Fan
11 Feb 2002, 06:13
Originally posted by Jawelin
Actually I get - now, for example, an html page containing only

I got a similar error when I replaced the contents of over's servstats.php with cruz's bla.txt because I was also getting parse errors. I've gone back to over's version but am getting the parse errors once more.

Jawelin
11 Feb 2002, 15:40
Infact I'm using the bla.txt version, as the Over's original one always gave me parse errors...
:confused:

Jawelin
19 Feb 2002, 23:28
Nobody's here ???