How to check if server is up and running in Unix. Users can check running services in Linux and check server status in putty using server health check commands in Linux.
To find the uptime of a Linux server one can use any one of the following commands:
- uptime command – Tell how long the Linux system has been running
- w command – Show who is logged on and what they are doing including the uptime of a Linux box
- top command – Display Linux server processes and display system Uptime in Linux too.
How to check system uptime in Linux
Open the terminal application on Linux and type the following uptime command:
uptime -p
The uptime command gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
The command option we have used is -p, –pretty which show uptime in pretty format. You can also used -s, –since which will give system up time since, in yyyy-mm-dd HH:MM:SS format.
The w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process.
The top command provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for processes are all user configurable.