[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xymon] New UPS monitor added to Xymonton
- To: xymon (at) xymon.com
- Subject: Re: [xymon] New UPS monitor added to Xymonton
- From: Bill Arlofski <waa-hobbitml (at) revpol.com>
- Date: Wed, 28 Jul 2010 12:46:55 -0400
- Organization: Reverse Polarity, LLC
- References: <4C3CF07D.9020709 (at) revpol.com> <AANLkTin5JioI4gLqdKDGaBFhdOwEQnuNgOBUT0b2WdcK (at) mail.gmail.com> <AANLkTimxWE4uXmLnvtywK6P74QPCTCY_tc7CicaqBJbE (at) mail.gmail.com> <4C505656.7060107 (at) revpol.com> <AANLkTim=hG2s0z33CZX2fHe3bDo9CN4bXAzjy6Og=Hz4 (at) mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100412 Thunderbird/3.0.4
On 07/28/10 12:29, Josh Luthman wrote:
> >Unless I am mistaken, the test I wrote will be set the status to yellow if
> the
>> UPS load is greater than or equal to $yellowtest (80%) and the status will
> be
>> set to red if the UPS load is eualto or greater than $redtest (80%).
>
> While this may be your intention that is not what I'm seeing. I am getting
> a red condition with these loads.
>
> - UPS load % for apcxxxxxr01 apcyyyy01 apczzzzzzzzz01 on 127.0.0.1
>
> apcxxxxxx01 : 51.00
> apcyyyy01 : 11.00
> apczzzzzzzz01 : 12.00
>
> My yellow and red are 80 and 90 like you suggest (or at least your default
> is =)
>
> -> cat ~myhobbituser/server/ext/xymon_nut_ups-load.sh|grep test
> datatest="ups\.load:"
> yellowtest="80"
> redtest="90"
>
> Josh Luthman
Ah... I see it...
Your UPS reports load % with two decimal points (51.00), mine reports % load
with one (35.6)
So the logic in the script is correct, but the part where I was stripping past
the decimal failed to take into account more than one decimal.
By only stripping the decimal and one numeral past it, the test is saying "if
510 > 90 then set the status to red"
To fix it, change the line:
datanopoint=`echo "$data" | "$SED" -e 's/\.[0-9]//'`
to
datanopoint=`echo "$data" | "$SED" -e 's/\.[0-9]\{1,2\}//'`
P.S. I already made all the changes I mentioned in may last email and will be
putting up the simplified versions possibly later today, including this fix.
Thanks Josh
--
Bill Arlofski
Reverse Polarity, LLC