[Nagiosplug-devel] Fwd: fix for AIX bug?
Ton Voon
tonvoon at mac.com
Thu Jan 13 12:37:11 CET 2005
Hi!
I've had no response to this, so I've gone ahead and made the changes
to use floats instead. It works on Sol2.6, but haven't had a chance to
test on other platforms. Any feedback welcome.
Ton
On 6 Jan 2005, at 23:07, Ton Voon wrote:
> Hi!
>
> I'm looking for some opinions on this, because it could be a major
> change and I don't know it well enough to spot possible pitfalls.
>
> Sean has found a problem with the use of unsigned long long on AIX
> with check_swap - see his explanation below. I'm not hugely familiar
> with this integer type (64 bit only?), but looking through the
> coreutils code (which I use for inspiration), the od.c code has some
> horribly complicated use of different functions with different printf
> statements depending on whether unsigned long long is supported or not
> (similar to Sean's changes from %llu to %lu). I don't really want to
> go down this route.
>
> I personally think that instead of trying to use unsigned long long or
> whatever maximum integer is supported on the OS, we should just use
> floating point variables instead. The reasons are:
>
> - for plugins, which is executed quickly then closed, there is no long
> term cost in CPU or memory for using floats instead of the more
> efficient integers
> - there is no need for the accuracy of integer values - to check
> thresholds, floating point precision (which gets less accurate as the
> numbers get higher) should be sufficient
> - simpler coding
>
> So the questions are: is it worth trying to make this change now
> during the beta phase? Will the changes be simple %llu to %f in
> appropriate places?
>
> Thanks to Sean for his investigations.
>
> Ton
>
> Begin forwarded message:
>
>> From: "Sean M. Shore" <smshore at bitstream.net>
>> Date: 6 January 2005 22:03:11 GMT
>> To: tonvoon at mac.com
>> Subject: fix for AIX bug?
>>
>> Ton:
>>
>> I think I know the problem with bug #1093522 (check_swap not working
>> on
>> AIX). It appears that AIX doesn't like the use of unsigned long longs
>> for several of the key variables (used_swap, free_swap, etc.). If I
>> change them to unsigned longs instead, and change some of the printfs
>> to
>> use %lu instead of %llu, everything works OK. I'm not a programmer,
>> so
>> please forgive my inability to discuss this problem more intelligently
>> or submit a patch. I've updated the bug info on SF, but I am not sure
>> who else will see it, since it isn't assigned to anyone.
>>
>> Thanks.
>>
>> --
>> Sean M. Shore
>> smshore at bitstream.net
>> ---------------------
>> I just don't see why everyone is always ragging on Marie Antoinette.
>> I can so relate to her. She worked really hard to look that good.
>> People don't appreciate that kind of effort.
>> -- C.C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2941 bytes
Desc: not available
URL: <http://nagios-plugins.org/archive/devel/attachments/20050113/f6978402/attachment.bin>
More information about the Devel
mailing list