email alerts for memory or cpu exceeding thresholds

Hi Guys,

I hope this is an easy question: I need some kind of script or an idea how I can convince syslog to send an email to root or someone else once cpu usage exceeds 95% or the memory consumption (maybe via AVM value times 4k) exceeds 85% of my real memory on any of my 700 lpars. We're running AIX 5.3 + 6.1

Any idea? We have tivoli setup but this only generates tickets and according to the tivoli team only to one queue - my customer doesnt want tickets, he wants email.

Any bit of help here is highly appreciated.

Thanks and regards
zxmaus

I don't believe you can get syslog to send emails; I would write a script that ran a memory monitoring utility (e.g. top -b | grep Memory | awk '{ print $2 }', what you grep for and which column you select will depend on your version of top) and got the script to call mailx/mail/sendmail and run it from cron at frequent and regular intervals.

An AIX admin would probably use RMC which is part of the OS since 5L and brings monitors exactly for what you asked: turn on / turn off events on conditions and send email and/or do some other action from there. Forget scripts that watch usage of filesystems, cpu and memory usage and so on. We don't need that. RMC has been there for years ready to use. Just pick one of the 80+ monitors and adapt or adjust it to your needs. Once you get used to it, you will love it. IBM Redbooks | A Practical Guide for Resource Monitoring and Control (RMC)

you should look into a real monitoring solution.
MRTG or cacti.

then you can alert of all sort of cool things.
server down, CPU usage, over temp, disk usage.

you may want to also have a closer look at Memory and use in AIX

Optimizing AIX 5L performance: Tuning your memory settings, Part 1

Optimizing AIX 6.1 performance tuning