Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Server Uptime Details »»
Server Uptime
Version: 1.00, by Etcher Etcher is offline
Developer Last Online: Aug 2004 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-27-2002 Last Update: Never Installs: 14
 
No support by the author.

Not really a HACK, but nice little script for information...

I added "System Uptime" to the footer of my site:

Save this as uptime.php:

<?PHP

$result = mysql_query("show status");
while ($row = mysql_fetch_array($result)){
if ($row['Variable_name'] == "Uptime") { $uptime = $row['Value']; }
}
$days = ((($uptime/60)/60)/24);
$wholeday = (int) $days;
$hours = (($days - $wholeday)*24);
$wholehour = (int) $hours;
$minutes = (($hours - $wholehour)*60);
$wholeminute = (int) $minutes;

echo "<center><font size=1>";
echo "System Uptime: ";
echo $wholeday . " Days ";
echo $wholehour . " Hours ";
echo $wholeminute . " Minutes <br>";
echo "</font></center>";

?>

Then "include" that file in your footer, or anywhere else you want it displayed.

The actual uptime is a check of mySQL dB.

Enjoy!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 07-02-2002, 03:55 AM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The uptime info doesnt match the 'top' command
Reply With Quote
  #43  
Old 07-03-2002, 12:47 AM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is what we use.
http://www.realwebhost.net/netstatus/
Reply With Quote
  #44  
Old 07-04-2002, 08:48 AM
Wildthinks's Avatar
Wildthinks Wildthinks is offline
 
Join Date: Apr 2002
Location: .:BeRLiN:.
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Etcher
Not really a HACK, but nice little script for information...
...cut.....
The actual uptime is a check of mySQL dB.
Enjoy!
I have enjoid, very nice hack, but waht mean uptime? The uptime from the mysql-Database?

How detected?

My server works over 40 days online and my uptime is 8 days?

I dont understand what uptime mean...please explain :alien: :knockedout:
Reply With Quote
  #45  
Old 09-16-2002, 02:51 PM
a43079's Avatar
a43079 a43079 is offline
 
Join Date: Aug 2002
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried the hack and this is the error i get...

Warning: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /home/www/eroweb/admin/uptime.php on line 8

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /home/www/eroweb/admin/uptime.php on line 8

Warning: MySQL: A link to the server could not be established in /home/www/eroweb/admin/uptime.php on line 8

Warning: Supplied argument is not a valid MySQL result resource in /home/www/eroweb/admin/uptime.php on line 9

System Uptime: 0 Days 0 Hours 0 Minutes
------------------------------------------------------------------------------
This is from the admin menu
Reply With Quote
  #46  
Old 09-16-2002, 10:49 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Wildthinks


I have enjoid, very nice hack, but waht mean uptime? The uptime from the mysql-Database?

How detected?

My server works over 40 days online and my uptime is 8 days?

I dont understand what uptime mean...please explain :alien: :knockedout:
Uptime = how long your server has been running before it had downtime ie. went offline because of a reboot, crash etc.

Also, correct me if I'm wrong, but this would an extra query to every page if you place this in your footer, wouldn't it?
Reply With Quote
  #47  
Old 02-15-2003, 04:12 PM
pjgoncalves pjgoncalves is offline
 
Join Date: Dec 2001
Location: Portugal
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tks

Quote:
Originally posted by nuno
*gee*
paste this into your phpinclude template
PHP Code:
$result mysql_query("show status"); 
while (
$row mysql_fetch_array($result)){ 
if (
$row['Variable_name'] == "Uptime") { $uptime $row['Value']; } 

$days = ((($uptime/60)/60)/24); 
$wholeday = (int) $days
$hours = (($days $wholeday)*24); 
$wholehour = (int) $hours
$minutes = (($hours $wholehour)*60); 
$wholeminute = (int) $minutes
paste this into your footer template, right after $copyrighttext<br>
Code:
<smallfont>System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes
</smallfont>
All done
Reply With Quote
  #48  
Old 02-15-2003, 07:17 PM
chr@nox chr@nox is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin


Uptime = how long your server has been running before it had downtime ie. went offline because of a reboot, crash etc.

Also, correct me if I'm wrong, but this would an extra query to every page if you place this in your footer, wouldn't it?
as far as i can see yea..looks like it adds an extra query for every page
but anyhow...very nice hack
thanx!
Reply With Quote
  #49  
Old 03-21-2003, 10:02 PM
Snapperhaed Snapperhaed is offline
 
Join Date: Mar 2003
Location: Argentina
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked fine on v2.3.3 (Nunos Method) - Thanks!
Reply With Quote
  #50  
Old 03-31-2003, 10:59 AM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked great - thx for the hack .
Reply With Quote
  #51  
Old 03-31-2003, 12:11 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can the original hack author please put the hack in a textfile to prevent unlicensed users from seeing the code

Thanks

- miSt
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:23 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.04516 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete