This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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