Sorun mysql ile ilgili degil, uygulamalar oyun sunucusu hepsi ayrı bir sunucu ve bazen bazı sunucular %100 yük yapıyor ve makinanın kilitlenmesine sebeb oluyor, bunları 5 dakika da bir kontrol ettirmek istiyorum


Bir tane script buldum ama apache ye göre ayarlanmış acaba bunu degiştirebilirmiyiz?

#!/bin/sh

max_cpu="10" # Set to max cpu. This is the max % you will allow no decimals.
apache_name="httpd" # Set to the name that apache runs as. Usually apache but sometimes it may be httpd.

cpu_usage_apache=$(ps xua | grep -iw $apache_name | grep -v grep | awk '{print $3}' | sed -e 's/..$//' | awk '!L[$0]++' | sort -nr)

if [ -z "$cpu_usage_apache" ]; then
        echo "not running"
        exit 1
fi
  
for i in $cpu_usage_apache; do

        if [ "$i" -gt "$max_cpu" ]; then
                ps xua | grep -iw $apache_name | grep -v grep | awk '{print $2}' | xargs kill
                exit 0
        
        else
                echo >/dev/null
        fi
          
done      

exit 0