Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View albarki's full-sized avatar
😁

Ibrahim Mohamed albarki

😁
View GitHub Profile
@albarki
albarki / diskmon.sh
Last active June 25, 2018 16:35 — forked from fduran/gist:1870429
Linux disk space email alert
#!/bin/bash
# www.fduran.com
# script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
# adapt these 3 parameters to your case
MAX=95
EMAIL=alertemail@example.com,alteremail2@example.com
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then
@albarki
albarki / rds.sh
Created July 7, 2018 21:46
Get List of RDS instances from All regions
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing RDS in region:'$region'..."
aws rds describe-db-instances \
--region $region \
--query 'DBInstances[*].[DBInstanceIdentifier,ReadReplicaDBInstanceIdentifiers]'
done