#!/bin/bash
loadavg=$(uptime | awk -F “.” ‘{ print $1 }’ | awk -F “:” ‘{ print $5 }’)
if [ “$loadavg” -ge “10” ]; then
pkill -9 httpd
sleep 3
/scripts/restartsrv_httpd
fi
#!/bin/bash
loadavg=$(uptime | awk -F “.” ‘{ print $1 }’ | awk -F “:” ‘{ print $5 }’)
if [ “$loadavg” -ge “10” ]; then
pkill -9 httpd
sleep 3
/scripts/restartsrv_httpd
fi
where should I save this script and how to run it?
LikeLike
You can run this script from shell.
Save this script to any test file (eg: apache10.sh) and run by using the command:
sh apache10.sh
LikeLike