1753878 Members
7433 Online
108809 Solutions
New Discussion юеВ

Re: Script

 
M.sureshkumar
Regular Advisor

Script

Hi All,

We need file system alert script for hp unix server.
Pls guide me.

Thanks&Regards,
Suresh.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Script

Shalom,

There are several good choices in this thread or the thread's it succeeded:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050

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
Arturo Galbiati
Esteemed Contributor

Re: Script

Hi Suresh,
this is an example:

#!/bin/sh
# This script can be used to
# warn the users that
# the file system is getting full
#
# Script needs adjusted for your
# needs. Below is set to monitor
# all the file systems mounted and report to
# RECEIVER
#
# Usage: as a cron entry for best use.


RECEIVER=

for fs in `df -k|awk '{print $1}'|sed -n "3,14 p"`
do
x=`df -kl | grep $fs | awk '{ print $5 }'`
y=50%

if [ $x -gt $y ]
then
message="File System `df -k |grep $fs |awk '{print $6\",
\"$5}'` Full!!!"
echo $subject
echo $message | mailx -s "`hostname` - File System Full
Warning !!!" $RECEIVER
fi
done

HTH,
Art
Arturo Galbiati
Esteemed Contributor

Re: Script

Hi Suresh,
this is a one line script:

# Show disk with pct used >= PCT
bdf|awk -v PCT=30 'NR==1||(substr($5,1,index($5,"%")-1)+0>=PCT)'|mailx -s "disk over $PCT" emailaddress


HTH,
Art
Arturo Galbiati
Esteemed Contributor

Re: Script

Hi Suresh,
the attached script by Bill Hassel is completly configurable.

HTH,
Art
Arturo Galbiati
Esteemed Contributor

Re: Script

Hi Suresh,
please, assign point to replies.
Rgds,
Art
M.sureshkumar
Regular Advisor

Re: Script

Thanks