diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-04-16 10:30:15 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-04-16 10:30:15 +0200 |
commit | 55783753ae8f2d857a7225b7a93c1d47039e5a90 (patch) | |
tree | e077b61b0f004141712e7d16876f9c19175ac681 /remote/check_server_status.sh | |
download | conky-55783753ae8f2d857a7225b7a93c1d47039e5a90.tar.gz conky-55783753ae8f2d857a7225b7a93c1d47039e5a90.tar.bz2 conky-55783753ae8f2d857a7225b7a93c1d47039e5a90.tar.xz conky-55783753ae8f2d857a7225b7a93c1d47039e5a90.zip |
OpenShift monitoring
Diffstat (limited to 'remote/check_server_status.sh')
-rwxr-xr-x | remote/check_server_status.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/remote/check_server_status.sh b/remote/check_server_status.sh new file mode 100755 index 0000000..791ad12 --- /dev/null +++ b/remote/check_server_status.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +fs=`df -m | grep /dev/sda2 | sed -e 's/[[:space:]]\+/ /g' | cut -d ' ' -f 4` +mem=`free -m | grep "buffers/cache" | sed -e 's/[[:space:]]\+/ /g' | cut -d ' ' -f 4` +cpu=`uptime | sed -e "s/[[:space:]]/\n/g" | tail -n 1` + +if [ $fs -le 8192 ]; then + echo "Only $(($fs / 1024)) GB left in the file system" +fi + +if [ $mem -le 128 ]; then + echo "The system is starving on memory, $mem MB left free" +fi + +#Multiply by number of CPU cores +if [ `echo "$cpu < 0.98" | bc` -eq 0 ]; then + echo "The system is starving on cpu, $cpu is load average for the last 15 min" +fi |