Operating System - HP-UX
1838048 Members
3806 Online
110124 Solutions
New Discussion

Re: Script to send email alert

 
SOLVED
Go to solution
Ray Allen_1
Frequent Advisor

Script to send email alert

Hi Super experts out there.
I was wondering if there was a small script out there that could send an email alert before nfiles reaches its maximum. The column under file-sz.

10:14:26 text-sz ov proc-sz ov inod-sz ov file-sz ov
10:14:31 N/A N/A 1101/4096 0 2198/34816 0 97264/220010 0
10:14:36 N/A N/A 1100/4096 0 2196/34816 0 97289/220010 0
10:14:41 N/A N/A 1100/4096 0 2196/34816 0 97404/220010 0
10:14:46 N/A N/A 1101/4096 0 2197/34816 0 97517/220010 0
10:14:51 N/A N/A 1099/4096 0 2197/34816 0 97403/220010 0

Our Database crashed the other day with the "file table full" and "file table overflow" errors. nfils is already set at 22000, maxfiles at 4000 and maxfiles_lim at 4096.

Any ideas would be greatly appreciated.
3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: Script to send email alert

Ray,
in principle:
cron a process that does

#!/usr/bin/sh
# Monitor the system and re-direct the output
sar -v 2 2> x.x
# Pick the last line and get the count
count=`tail -2 x.x | head -1 | awk '{print $4}' | awk -F'/' '{print $1}'`
# Send a messages if above a level
if ( $count -ge 3500 )
then
mailx -s"Warning on proc-sz" a.b@aol.com
fi
Tim Nelson
Honored Contributor

Re: Script to send email alert

Another way if you have glance.

You can configure the alarmdef to monitor the table usage metric. The alarm would then exec any script you would like, i.e. send an email.

Steven E. Protter
Exalted Contributor

Re: Script to send email alert

Shalom,

http://www.hpux.ws/mailfile2

This includes all needed code. I can also do attachments.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com