<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
No need for awk:<br>
<br>
Joe Philip wrote:
<blockquote cite="mid:_Ya0b.6873$N37.6552 [at] nwrdny02.gnilink.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2800.1106" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">I have a script to check the "df
-k" output. Some of our mount points are permanently 100% full. I
want to check all the mount points except the ones which are in my
list.</font></div>
<div> </div>
<div><font face="Arial" size="2">For example, I want to modify the
following script so that it checks all the mount points which are
more than 98% full except the ones on the FULL_LIST. What is the
corrent syntax to do this line:</font></div>
<div><font face="Arial" size="2"> <font color="#ff0000">if [
mnt_pt not in $FULL_LIST ]; then</font></font></div>
<div> </div>
<div><font face="Arial" size="2"> ------------------------------------------------------------ ---------------------------------</font></div>
<div>
<p><font face="Arial" size="2">#!/bin/ksh</font></p>
<p><font color="#ff0000" face="Arial" size="2">FULL_LIST="/u110
/u05"</font></p>
<p><font face="Arial" size="2">df -k | grep -iv filesystem | awk '{
print $6" "$5}' | while read LINE; do</font></p>
</div>
</blockquote>
df -k |\<br>
while read -A REC; do<br>
[[ ${REC[5]} == +([[:digit:]]) || && ${REC[6]} ==
+([[:digit:])) ]] || continue<br>
print Do something here.<br>
done<br>
<blockquote cite="mid:_Ya0b.6873$N37.6552 [at] nwrdny02.gnilink.net"
type="cite">
<div>
<p><font face="Arial" size="2">PERC=`echo $LINE | cut -d"%" -f1 |
awk '{ print $2 }'`</font></p>
<p><font face="Arial" size="2">TST=`echo $LINE | cut -d"%" -f1 |
awk '{ print $1 }'`</font></p>
<p><font face="Arial" size="2">if [ $PERC -gt 98 ]; then</font></p>
<p><font face="Arial" size="2"> <font color="#ff0000">if [
mnt_pt not in $FULL_LIST ]; then</font></font></p>
<p><font face="Arial" size="2"> echo "${PERC}% ALERT" | Mail -s
"${LINE} on `hostname` is almost full" </font><a
moz-do-not-send="true" href="mailto:mail [at] mail.com"><font face="Arial"
size="2">mail [at] mail.com</font></a></p>
<p><font face="Arial" size="2"> fi</font></p>
<p><font face="Arial" size="2">fi</font></p>
<p><font face="Arial" size="2">done</font></p>
</div>
<div> </div>
</blockquote>
<br>
</body>
</html>
