vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   My 1st hack :) Server Health (https://vborg.vbsupport.ru/showthread.php?t=32496)

over 11-17-2001 10:00 PM

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:

Example
4:32pm  up 10 days, 20:34,  2 users,  load average: 0.12, 0.15, 0.35
154 processes: 151 sleeping, 1 running, 2 zombie, 0 stopped
Mem:  1545952K av, 1428608K used,  117344K free,      0K shrd,  22372K buff
Swap: 1052216K av,      0K used, 1052216K free                  876512K cached


Sun Nov 18 16:32:16 GMT 2001

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:

$mysqladmin and $mysqllogin
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:

// *************************************************
makenavoption("Add","announcement.php?action=add","|");
makenavoption("Modify","announcement.php?action=modify");
makenavselect("Announcements");
// ***

Below that add

Code:

// Server Stats
makenavoption("Server Information","servstats.php","|");
makenavselect("Server Health");
// Server Stats End

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?...cksEdit&bid=15)

Find:
Code:

<strong><big>?</big></strong> <a href="/forums/admin/index.php">VB Admin</a><br>
Under that add:
Code:

<strong><big>?</big></strong> <a href="/forums/admin/servstats.php">Server Health</a><br>
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:

echo "<center><font size=\"4\"><b><a href=\"admin.php\">"._ADMINMENU."</a></b>";
Under that add

Code:

echo "<center><font size=\"4\"><b><a href=\"/forums/admin/servstats.php\">Server Health</a></b>";
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 11-18-2001 06:11 PM

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 11-18-2001 06:30 PM

Gotta give this a try. :)

LDT 11-18-2001 06:44 PM

Quote:

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 11-18-2001 07:01 PM

Quote:

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 11-18-2001 10:28 PM

I will try it out tonight or tommrow

LDT 11-19-2001 02:07 PM

Code:

Parse error: parse error in /var/www/html/forums/admin/servstats.php on line 24
Any ideas?

LDT 11-19-2001 02:16 PM

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:
PHP Code:

{  // display all except CPU details      $buffer = rtrim (fgets ($fp, 1024));      if (substr ($buffer, 0, 11) != "CPU states:")        echo "$buffer\n";    }  } 

I also think it's better to add
PHP Code:

makenavoption("Server Status","servstats.php?action=choose","<br>"); 

right before
PHP Code:

makenavoption("Statistics","stats.php?action=index","<br>"); 

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

// Server Stats
makenavoption("Server Information","servstats.php","|");
makenavselect("Server Health");
// Server Stats End

so that it looks like this
Code:

// Server Stats
makenavoption("Server Information","servstats.php");
makenavselect("Server Health");
// Server Stats End

as it isn't needed.

over 11-19-2001 04:37 PM

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 11-19-2001 05:19 PM

Great, I'll be waiting. :)

over 11-20-2001 06:14 PM

fixing a couple of issues with the disc space addition, not forgotten to update, doesnt work properly yet.

Cruz 11-26-2001 12:00 AM

after getting many many parse errors, i got it working....here is the new file:

exodus 12-08-2001 10:43 PM

you may want to add the "httpd" processes cpu utilization.

Jawelin 02-02-2002 09:39 PM

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:
Quote:

<body><pre>

Sat Feb 2 18:40:22 EST 2002

</pre></body></html>
Bah ?!?

haas 02-07-2002 03:37 AM

Uhmmm. Seems very good.... I'll install it when I get a *nix box for the board.

Jawelin 02-09-2002 08:27 AM

Quote:

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 02-11-2002 04:13 AM

Quote:

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 02-11-2002 01:40 PM

Infact I'm using the bla.txt version, as the Over's original one always gave me parse errors...
:confused:

Jawelin 02-19-2002 09:28 PM

Nobody's here ???


All times are GMT. The time now is 04:46 PM.

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.02314 seconds
  • Memory Usage 1,768KB
  • 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
  • (11)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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