How to get alert email for hard disk and ram utilization

Crucificator crucificator at home.ro
Mon Nov 22 14:30:34 UTC 2004


Asim Ansari wrote:

>Hi Folks,
>
> 
>
>Running Red Hat Linux 8.0. 
>
> 
>
>I need to get email alert when RAM utilization on my server is above 80% and
>free disk space is 30%, I don't have any SMTP service running on this
>machine, I want to send this email through smtp server running on another
>machine in my LAN.
>
> Asim
>
>
>
> 
>
>  
>

for user in $(users); do
 cpu=$(ps h -U $user -o pcpu|paste -sd+|bc)
 [[ ${cpu/./} -gt 100 ]] && \
  echo "Fsck off, you're eating my cpu!"|mail -s "READ NOW !!!" $user
done






More information about the redhat-list mailing list