That fixed it!  Thank you!<br><br clear="all">Josh Luthman<br>Office: 937-552-2340<br>Direct: 937-552-2343<br>1100 Wayne St<br>Suite 1337<br>Troy, OH 45373<br>
<br><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 12:46 PM, Bill Arlofski <span dir="ltr"><<a href="mailto:waa-hobbitml@revpol.com">waa-hobbitml@revpol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On 07/28/10 12:29, Josh Luthman wrote:<br>
>  >Unless I am mistaken, the test I wrote will be set the status to yellow if<br>
> the<br>
>> UPS load is greater than or equal to $yellowtest (80%) and the status will<br>
> be<br>
>> set to red if the UPS load is eualto or greater than $redtest (80%).<br>
><br>
> While this may be your intention that is not what I'm seeing.  I am getting<br>
> a red condition with these loads.<br>
><br>
> - UPS load % for apcxxxxxr01 apcyyyy01 apczzzzzzzzz01 on 127.0.0.1<br>
><br>
> apcxxxxxx01 : 51.00<br>
> apcyyyy01 : 11.00<br>
> apczzzzzzzz01 : 12.00<br>
><br>
> My yellow and red are 80 and 90 like you suggest (or at least your default<br>
> is =)<br>
><br>
> -> cat ~myhobbituser/server/ext/xymon_nut_ups-load.sh|grep test<br>
> datatest="ups\.load:"<br>
> yellowtest="80"<br>
> redtest="90"<br>
><br>
> Josh Luthman<br>
<br>
<br>
</div>Ah... I see it...<br>
<br>
Your UPS reports load % with two decimal points (51.00), mine reports % load<br>
with one (35.6)<br>
<br>
So the logic in the script is correct, but the part where I was stripping past<br>
the decimal failed to take into account more than one decimal.<br>
<br>
By only stripping the decimal and one numeral past it, the test is saying "if<br>
510 > 90 then set the status to red"<br>
<br>
<br>
To fix it, change the line:<br>
<br>
datanopoint=`echo "$data" | "$SED" -e 's/\.[0-9]//'`<br>
<br>
to<br>
<br>
datanopoint=`echo "$data" | "$SED" -e 's/\.[0-9]\{1,2\}//'`<br>
<br>
<br>
P.S. I already made all the changes I mentioned in may last email and will be<br>
putting up the simplified versions possibly later today, including this fix.<br>
<br>
<br>
Thanks Josh<br>
<div><div></div><div class="h5"><br>
--<br>
Bill Arlofski<br>
Reverse Polarity, LLC<br>
<br>
To unsubscribe from the xymon list, send an e-mail to<br>
<a href="mailto:xymon-unsubscribe@xymon.com">xymon-unsubscribe@xymon.com</a><br>
<br>
<br>
</div></div></blockquote></div><br>