Check system uptime in AlmaLinux 9

Published: December 22, 2022

Last updated: December 22, 2022

Check system uptime in AlmaLinux 9

In this article, we cover how to check system uptime in AlmaLinux 9. The two tools which can help us get required system uptime data are -

  1. htop and,
  2. uptime.

It may seem trivial for a regular user to monitor system uptime. But, in critical infrastructure environments much importance is given to it. We expect our system to run 24 hours a day. If that isn't happening then definitely there are reliability issues and must be investigated.

Note: Following operations (i.e. htop package installation) require superuser privileges. In case you don't have one then we advise you to contact your System Administrator for assistance.

Use htop to check system uptime in AlmaLinux 9

So, first we have htop tool. The package is available through EPEL repository. Therefore, if haven't yet installed EPEL repository then install it through the following command -

# dnf install epel-release

Thereafter, to install htop -

# dnf install htop

To run htop -

$ htop

Top right, you would get the uptime details. It shows systems' uptime in HH:MM:SS format.

Use "uptime" to check system uptime in AlmaLinux 9

Alternately, we can also use uptime command-line tool to check system uptime. Just issue the following in terminal -

$ uptime

For us, it returned with (output would be different for you) -

08:13:34 up 6 min, 1 user, load average: 0.02, 0.46, 0.32

First, it shows us current time - 08:13:34.

Then, its up 6 min - for how long our system has been up and running.

1 user - shows how many users are currently logged in.

Lastly, load average: .02, 0.46, 0.32 - shows system load over 1, 5 and 15 minutes.

If you want system uptime in pretty format then use -p option

$ uptime -p

And, if you want to know for how long (output includes both date and time) our system has been up and running -

$ uptime -s

In conclusion, if our system runs in a critical infrastructure environment then it is necessary to monitor system uptime regularly. Two command-line tools - htop and uptime can get up the required data.