Operating System - HP-UX
1825768 Members
2029 Online
109687 Solutions
New Discussion

Re: Automatic notification file system getting full...

 
SOLVED
Go to solution
Michael Francisco
Trusted Contributor

Automatic notification file system getting full...

This is probably a no brainer, but I would like to setup a threshold level based on percent full that when reached causes the system to send out an email or a page. It seems that I'm receiving a message that the file system is full - probably from dmesg, but the system used to send an email when the file system reached 90% used -- that is until a consultant touched it...

TIA
Michael
Uhhh...no
6 REPLIES 6
Rob Smith
Respected Contributor
Solution

Re: Automatic notification file system getting full...

Hi, try this script:
#!/usr/bin/sh

bdf | grep -iv filesystem | awk '{print $6 " "$5}' | while
read LINE; do
PERC=`echo $LINE | cut -d "%" -f1 | awk '{ print $2 }'`
if [[ $PERC -gt 90 ]]; then
echo "${PERC}% ALERT!" | mailx -s "${LINE} on `hostname` is almost full" root
fi
done

exit

Have cron fire it off every hour or so. Hope this helps.

Rob



Learn the rules so you can break them properly.
MANOJ SRIVASTAVA
Honored Contributor

Re: Automatic notification file system getting full...

Do the following



bdf | awk '{if ($5 > "90") print $NF,$5 }' > /tmp/test


This will create a file test in /tmp with the files sytems and the values of the usage. You can be creative in using this file as a form of mail , message etc . Run this as a part of script .

Manoj Srivastava
Tom Gore
Regular Advisor

Re: Automatic notification file system getting full...

I use this one. It sends a page to a printer.
Michael Francisco
Trusted Contributor

Re: Automatic notification file system getting full...

Wow! Almost instant response! I still haven't received response back from HP on our 24/7 4hr response time software contract...

Many thanks to all who replied
Michael
Uhhh...no
Thierry Poels_1
Honored Contributor

Re: Automatic notification file system getting full...

hi,
there's a very big difference in having 10% free on a 100MB filesystem or an a 100GB filesystem!! I think it would be a little bit more ideal to check on percentage combined with a check on effective free space.
just my 2 cents,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Robert Hoey
Advisor

Re: Automatic notification file system getting full...

Here's another one that might help. We run it in the cron every fifteen minutes, but it will only e-mail you once an hour. Also, it checks off of the percentage and the value to exceed can easily be changed from 90 to 85 to 95, etc.

Good Luck.

-Rob