Skip to content

Instantly share code, notes, and snippets.

@igorhrq
Created Jun 26, 2020
Embed
What would you like to do?
#!/bin/bash
load=`echo $(cat /proc/loadavg | awk '{print $1}') \> 8 | bc -l`
Release() {
release=$(egrep "5|6" /etc/redhat-release | awk {'print $4'} | cut -d. -f1)
if [[ -z $release ]]; then
mailPath=/usr/bin/mail
else
mailPath=/bin/mail
fi
}
if [ "$load" -ne 0 ]; then
Release
$mailPath -s "Load está alto $(hostname) Acima de $load " hey@igorlnx.com <<-MENSAGEM
** Esta é uma mensagem automática **
===================
O load vigente é:
$(w|head -1)
===================
MENSAGEM
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment