df, grep, wild card

Hi,

I want to monitor my filesystem capacity and I want to df with grep wildcard for all 9*%.

Is this possible? I want to replaced all the existing complicated scripts I have in the system.

Thanks,
Itik

df | grep 9.%

If your system is running AIX 5.2 or 5.3, I would suggest using the AIX Remote Monitoring and Control (RMC) facility. Run the following command to see if the required fileset is installed:

lslpp -l rsct.core.errm

If it is installed, then you can let the AIX kernel monitor the filesystem space used. The operating system can be configured to send alerts both when the space used goes above a specified level and also when it drops below a specified level.

The following command creates a monitoring condition called "Filesystem space 2" to monitor the filesystems /u01 and /u02. An event will be generated when the space used goes above 85% and a rearm event will be generated when it falls below 80% (the following all goes on one line):

mkcondition -r "IBM.FileSystem" -e "PercentTotUsed > 85"
-E "PercentTotUsed < 80" -d "An event will be generated when more than 85 percent of the total space of the filesystem is in use." -D "The event will be rearmed when the percent of the space used in the filesystem falls below 80 percent." -s "Name == \"/u01\" || Name == \"/u02\"" -S i -m l "Filesystem space 2"

The following command creates a response called "E-mail app support" which is in effect seven days a week, 24 hours a day. It will send an e-mail to an alias "appmail" which is defined within /etc/aliases:

mkresponse -n "E-mail app support" -d "1-7" -t "0000-2400" -s "/usr/sbin/rsct/bin/notifyevent appmail" -r "-1" -e "b" "E-mail app support"

(Again, the above command would be typed all on one line)

Finally, you tie the response to the condition and start the monitoring:

startcondresp "Filesystem space 2" "E-mail app support"

Some of the commands that are available:

lscondition: lists existing conditions and their status (enabled/disabled)
lscondition "Filesystem space 2" (the quotes are required): lists the details about condition "Filesystem space 2"
lscondresp: lists existing responses