<span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)"> "Historically speaking, the presence of </span><em style="font-style:normal;font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">wheels</em><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)"> in Unix has never precluded their reinvention." - </span><em style="font-weight:bold;font-style:normal;font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">Larry Wall</em><br>
<br>This feature exists already.<div>Look for GROUP= in the alerts.cfg man page.</div><div><br></div><div>Regards</div><div>    Vernon<br><br><div class="gmail_quote">On 21 December 2011 21:58, McKinzie, Jody <span dir="ltr"><<a href="mailto:jmckinzie@thezenith.com">jmckinzie@thezenith.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am working on a script to configure alerts to notify different groups when a specific filesystem gets too full.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">For example, if mount point a gets 100% full notify group b<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If mount point b gets to be 100%, notify group b.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">$PERCENTUSED<u></u><u></u></p><p class="MsoNormal">$PERCENTALERT<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Also, how do I test via the command line?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks in advance.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-left:.5in">#!/bin/sh<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
single() {<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">while [ ! "$1" = "" ]<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">do<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   while [ ! "$1" = "&red" ]<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   do<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">      shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
      if [ "$1" = "" ]<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">      then<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">         exit<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
      fi<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   done<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">#&red /mnt/testA (100% used) has reached the PANIC level (99%)<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">   MOUNTPOINT=$1<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   PERCENTUSED=`cat $2 |cut -d"(" -f2`<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   PERCENTALERT=`cat $9 |cut -d"(" -f2 |cut -d")" -f1`<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   echo $MOUNTPOINT<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   echo $PERCENTUSED<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   echo $PERCENTALERT<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   lookup $1<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   echo $1 $2 $3 $4 $5 $6 $7 $8 $9<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   shift<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
done<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">}<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">lookup() {<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   MAILTOADDRESS=`grep $1 /usr/local/bin/bb/diskalerts/* |cut -d" " -f3`<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">   echo $BBHOSTNAME Disk Alert for $MOUNTPOINT reporting $PERCENTUSED of $PERCENTALERT Limit >>/var/tmp/diskalert.$$<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   echo To acknowledge use code $ACKCODE at >>/var/tmp/diskalert.$$<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   echo $ACKCODE >/var/tmp/ACKCODE<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   echo <a href="http://bigbrother.zic.pri/xymon-seccgi/bb-ack-enhanced.sh" target="_blank">http://bigbrother.zic.pri/xymon-seccgi/bb-ack-enhanced.sh</a> >>/var/tmp/diskalert.$$<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">
   echo >>/var/tmp/diskalert.$$<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">   cat /var/tmp/diskalert.$$ |mailx -s "Hobbit [$ACKCODE] ${BBHOSTNAME} disk CRITICAL ($BBCOLORLEVEL)" $MAILTOADDRESS<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in">#   rm /var/tmp/diskalert.$$<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">}<u></u><u></u></p><p class="MsoNormal" style="margin-left:.5in">single $BBALPHAMSG<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">------------------------------<u></u><u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b><span style="font-size:14.0pt;color:#4f81bd">Jody R. McKinzie<u></u><u></u></span></b></p>
<p class="MsoNormal">Sr. UNIX Administrator<u></u><u></u></p><p class="MsoNormal">Zenith Insurance Company<u></u><u></u></p><p class="MsoNormal">Desk: <a href="tel:%28941%29%20906-5177" value="+19419065177" target="_blank">(941) 906-5177</a><u></u><u></u></p>
<p class="MsoNormal">Cell:    <a href="tel:%28941%29%20806-8205" value="+19418068205" target="_blank">(941) 806-8205</a><u></u><u></u></p><p class="MsoNormal">Fax:    <a href="tel:%28941%29%20906-7945" value="+19419067945" target="_blank">(941) 906-7945</a><u></u><u></u></p>
<p class="MsoNormal">Email: <a href="mailto:jmckinzie@thezenith.com" target="_blank"><span style="color:blue">jmckinzie@thezenith.com</span></a><u></u><u></u></p><p class="MsoNormal"><a href="http://www.TheZenith.com" target="_blank"><span style="color:blue">www.TheZenith.com</span></a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p></div>
<p></p><pre>***********************************************************
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></p></div><br>_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>"While it is futile to try to eliminate risk, and questionable to try to minimize it, it is essential that the risks taken be the right risks. "<br>
- Peter F. Drucker <br><br>
</div>