Show server information

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
unplugme71
Forum Newbie
Posts: 13
Joined: Wed Jul 13, 2011 2:39 pm

Show server information

Post by unplugme71 »

I need to be able to show the following information

Distro Name:
Uptime:
Last Boot:
Current Users:


Distro Name - I'm able to show Debian Linux/GNU 6.0 - but I just want it to show Debian 6.0 or whatever OS I'm currently using.
For "Last Boot", i'm using this print(exec("who -b")); however, I only want it to show the date and time, and not 'system boot' or anything else.
I can't figure out how to show how many users are logged into the server like 'top' shows.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Show server information

Post by Celauran »

The uptime command will show how long the machine has been up, as well as the number of current users.
Post Reply