How to get alert email for hard disk and ram utilization

Pete Nesbitt pete at linux1.ca
Sat Nov 20 17:28:22 UTC 2004


On November 20, 2004 06:59 am, Asim Ansari wrote:
> We don't have the option of installing third party software on our server,
> we need any OS and cron job functionality as Microsoft has in windows
> called performance monitoring. Any thing like this in Linux.
>
>
> Asim Ansari

Hi Asim,
If Mikes info about diskcheck doesn't work for you, you could cron a shell 
script to extract info via df & free (or read /proc), then compare it to a 
preset value, and email if it is over that. 

The problem with memory is determining extended/average/mean/max periods, you 
don't want an email on every memory spike (caused by the last email!). And 
you don't want to just sample periodicly unless you looking for a misbehaving 
app. So you need to gather and plot it. 

You may also want to look at sar for gathering the info. 'man sar' It will 
tell you anything you need to know about disk, i/o, memory, network etc. You 
still need to extracty and analize the info against your presets.

I have an old script I used to use (just disk space) on a Solaris box. It 
probably needs some cleanup etc, but it may head you in the right direction.
Have a look at:
http://www.linux1.ca  -> scripts-> Sample Scripts -> "df-extreme.sh"
(http://nesbitt.yi.org:6690/files/df-extreme.sh.txt)



Hope that helps.
-- 
Pete Nesbitt, rhce




More information about the redhat-list mailing list