Uptime code??

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Post Reply
Gnome
User avatar
Staff
Posts: 2671
Joined: Thu Nov 30, 2006 6:10 pm
Location: Land of The Tea.
Contact:

Uptime code??

Post by Gnome »

Is there any sort of code to find the servers uptime?
This would be helpful for a page im making and would it work for getting the uptime of another server?

RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

You can use this utility for Windows servers:

http://www.betaarchive.co.uk/uptime.exe

Put on the same dir as the script.
PHP:

Code: Select all

echo passthru("uptime.exe HOST");
...where HOST is the desired host in UNC format, leave blank for local machine.

Gnome
User avatar
Staff
Posts: 2671
Joined: Thu Nov 30, 2006 6:10 pm
Location: Land of The Tea.
Contact:

Post by Gnome »

UNC format?

RichardG867
FTP Access
Posts: 596
Joined: Tue Oct 23, 2007 11:21 pm

Post by RichardG867 »

Simple as 1-2-3:

\\SERVERNAME

ftgba2244
FTP Access
Posts: 71
Joined: Sat Nov 17, 2007 7:32 am

Post by ftgba2244 »

Is there an easy program like that for Linux/BSD servers?

pr0gram the pr0grammer
Donator
Posts: 698
Joined: Fri Aug 18, 2006 12:05 pm
Location: Or-stray-liagh

Post by pr0gram the pr0grammer »

ftgba2244 wrote:Is there an easy program like that for Linux/BSD servers?
The command on Linux is called uptime... so you could go echo passthru("uptime");
pr0gram the pr0grammer
BetaArchive retiree | OSBA Expat

Post Reply