#!/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
Script for restarting apache at load 10
Share This Story, Choose Your Platform!
2 Comments
Leave A Comment
You must be logged in to post a comment.
where should I save this script and how to run it?
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