Use “df -Ph” (POSIX output format) to deal with this problem. Make a note: When using “df -h” in the shell script in some distributions, you may end up with the below error message as the output is not in the correct format. Refer to this article (embedded link), If you are looking for a bash script to monitor disk space usage on multiple remote Linux systems. These scripts will trigger an email to the corresponding email id when the system reaches a given threshold. We have included three shell scripts below and you can choose the one that suits your need. In this case, it is better to write a shell script based on what you need to monitor in your environment. However, it is suitable for small and large environments, but what is the best approach if you only have a few systems? There are various monitoring tools available that monitor everything, and trigger an email when the system reaches a given threshold.
0 Comments
Leave a Reply. |