I do not want to use Cloudwatch want to use shell script for this , Could you please suggest?
Actually i have written a script as below:
But its not alerting me when the EFS is unmounted.
#!/bin/bash Hostname=$(hostname) ##email subject subject="EFS is unmounted" ## sending mail to to="firstname.lastname@example.org" ## send carbon copy to also_to="email@example.com" ## Check if EFS is mounted or not efscommenpart=$(df -kh | grep amazonaws.com | cut -d "." -f4) ## If EFS is unmounted if [[ "$efscommenpart" -ne amazonaws ]] then echo -e "EFS is not mounted" | mailx -s "$subject" -r "$Hostname" -c "$to" "$also_to" fi
This is urgent...!!!