Friday, May 15, 2015

How To Check Health Status Of A Linux System [Updated]


Get Your System Health Status Tested/Checked Today... ????


#!----Here is a script to check the basic health status of a Linux system---#!
   
[[ Updated Recently On 30-Dec-2018 ]]

This script has been tested to run successfully on RHEL 8(beta)7/6/5.x, Cent OS, SLES/SLED 12/11, Ubuntu 18/6/14 x86 and x86_64 bit architectures. It may work on other variants as well, however, not tested. These tests were run on virtual machines.

This is a small, light-weight script which makes use of native Linux utilities to get the required details and doesn't need much space. This script could be added as a cron job to regularly get system details triggered via an email as desired. The script has been successfully tested to work on most popular Linux distributions. One may alter or change the script to get the desired function or task done.



Details of the script:

Name Of The Script: health-check.sh

Build To Run On: RHEL 8/7/6/5.x /SLES 12/11 , Cent OS x86/x86_64 architecture.

Who Can Run This Script: Root User Or sudo user.

Depends On: "sysstat" package & Other Native Commands.

Output: This Script would dump the details on the console.



Following checks would be performed:

<-> Mounted File Systems

<-> Read-only File System If Any

<-> File Systems Disk Usage

<-> I-node Usage

<-> Zombie Processes If Found

<-> RAM Utilization

<-> SWAP Utilization

<-> Processor Utilization

<-> Current Load Average

<-> Most recent reboot and shutdown stamps.

<-> Top 5 memory & CPU consuming resources.


Let’s Download And Execute:


Now, one could download and run the script to get the basic health check of a Linux system. Use the link provided below to download the script.

Change the file permissions to executable if required. You could run the below command to turn on the execute bit for root user:

# chmod u+x health-check.sh

If you are unable to download and move this script file to your Linux system then you may need to copy the complete contents of the file as it is and paste into your file, set execute bit and run it later.

All the best!!!


If someone is interested in automating this 'health-check.sh' script file then please visit my recent blog post:

https://www.simplylinuxfaq.com/2019/01/lets-automate-system-health-check-in-linux.html



More advanced version of this script file which can scan complete Linux system and pull out all hardware details is available as 'hwlist' package. Refer this blog page for more details:

https://www.simplylinuxfaq.com/p/how-to-find-hardware-details-in-linux.html






You may prefer to scan the download and then execute it.

View/read the release file:

View/read the script file here:

View/read a sample output file produced by running 'health-check.sh' script file :

7 comments:

anomyous said...

A great help to me, thanks a lot.

Anonymous said...

Really Good! Thanks.

Anonymous said...

Thank you. Very useful.

Anonymous said...

Very good. Thanks : )

Vahora Nakil said...

Thanks , very good

Anonymous said...

Keep this going please, great job!

Anonymous said...

Woah! I'm really enjoying the template/theme of this blog.
It's simple, yet effective. A lot of times it's very difficult to get that "perfect balance" between superb usability and
appearance. I must say you have done a great job with
this. In addition, the blog loads very quick for me on Firefox.

Outstanding Blog!