What I have is a simple script that I wrote and checks if the CPU or memory reaches the threshold which I consider it as high load. If it is, the script will call another script that will gather information for me to analyze what causes the highload and sends it to my e-mail address as an attachment. Below is a sample of my script that you may want to consider enhancing it and apply it to your needs.
#!/bin/bash
GATHER_INFO=<SCRIPT_NAME_HERE>
CPU_LOAD=$(uptime | cut -d"," -f4 | cut -d":" -f2 | cut -d" " -f2 | sed -e "s/\.//g")
CPU_THRESHOLD=<VALUE_HERE>
MEMORY_USAGE=$(free -m | grep -i "buffers/cache" | awk '{ print $3 }')
MEMORY_THRESHOLD=<VALUE_HERE>
if [ $CPU_LOAD -gt $CPU_THRESHOLD ] ; then
$GATHER_INFO # I call another script here.
<SEND_INFORMATION_GATHERED_BY_EMAIL_HERE> # I use nail/mailx here.
exit 0
elif [ $MEMORY_USAGE -gt $MEMORY_THRESHOLD ] ; then
$GATHER_INFO # I call another script here.
<SEND_INFORMATION_GATHERED_BY_EMAIL_HERE> # I use nail/mailx here.
exit 0
fi
exit 0
Please take note that the external script $GATHER_INFO depends on tools that are already installed in your system (e.g. sysstat).
I have answered a similar problem and is located here for your reference.
I also used Munin and it's very simple to use but the problem with it is that the disk I/O is too high on the Munin server which is not practical if you host it in one of the EC2 instance unless you are only monitoring a few number of instances.