<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am working on a script to configure alerts to notify different groups when a specific filesystem gets too full.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For example, if mount point a gets 100% full notify group b<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If mount point b gets to be 100%, notify group b.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is what I have so far.  But, I cannot seem to get the output to produce the  output for these variables.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$PERCENTUSED<o:p></o:p></p><p class=MsoNormal>$PERCENTALERT<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Also, how do I test via the command line?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks in advance.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>#!/bin/sh<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>single() {<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>while [ ! "$1" = "" ]<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>do<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   while [ ! "$1" = "&red" ]<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   do<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>      shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>      if [ "$1" = "" ]<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>      then<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>         exit<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>      fi<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   done<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>#&red /mnt/testA (100% used) has reached the PANIC level (99%)<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   MOUNTPOINT=$1<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   PERCENTUSED=`cat $2 |cut -d"(" -f2`<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   PERCENTALERT=`cat $9 |cut -d"(" -f2 |cut -d")" -f1`<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $MOUNTPOINT<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $PERCENTUSED<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $PERCENTALERT<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   lookup $1<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $1 $2 $3 $4 $5 $6 $7 $8 $9<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   shift<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>done<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>}<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>lookup() {<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   MAILTOADDRESS=`grep $1 /usr/local/bin/bb/diskalerts/* |cut -d" " -f3`<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $BBHOSTNAME Disk Alert for $MOUNTPOINT reporting $PERCENTUSED of $PERCENTALERT Limit >>/var/tmp/diskalert.$$<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo To acknowledge use code $ACKCODE at >>/var/tmp/diskalert.$$<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo $ACKCODE >/var/tmp/ACKCODE<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo http://bigbrother.zic.pri/xymon-seccgi/bb-ack-enhanced.sh >>/var/tmp/diskalert.$$<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   echo >>/var/tmp/diskalert.$$<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>   cat /var/tmp/diskalert.$$ |mailx -s "Hobbit [$ACKCODE] ${BBHOSTNAME} disk CRITICAL ($BBCOLORLEVEL)" $MAILTOADDRESS<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>#   rm /var/tmp/diskalert.$$<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>}<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>single $BBALPHAMSG<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>------------------------------<o:p></o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-size:14.0pt;color:#4F81BD'>Jody R. McKinzie<o:p></o:p></span></b></p><p class=MsoNormal>Sr. UNIX Administrator<o:p></o:p></p><p class=MsoNormal>Zenith Insurance Company<o:p></o:p></p><p class=MsoNormal>Desk: (941) 906-5177<o:p></o:p></p><p class=MsoNormal>Cell:    (941) 806-8205<o:p></o:p></p><p class=MsoNormal>Fax:    (941) 906-7945<o:p></o:p></p><p class=MsoNormal>Email: <a href="mailto:jmckinzie@thezenith.com"><span style='color:blue'>jmckinzie@thezenith.com</span></a><o:p></o:p></p><p class=MsoNormal><a href="http://www.TheZenith.com"><span style='color:blue'>www.TheZenith.com</span></a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div>
<P><pre wrap>***********************************************************
NOTICE:
This e-mail, including attachments, contains information
that may be confidential, protected by the attorney/client
or other privileges, or exempt from disclosure under
applicable law.  Further, this e-mail may contain
information that is proprietary and/or constitutes a trade
secret.  This e-mail, including attachments, constitutes 
non-public information intended to be conveyed only to the
designated recipient of this communication, please be
advised that any disclosure, dissemination, distribution,
copying, or other use of this communication or any attached
document is strictly prohibited.  If you have received this
communication in error, please notify the sender
immediately by reply e-mail and promptly destroy all
electronic and printed copies of this communication and
attached documents.

***********************************************************
</pre></P></body></html>