[Nagiosplug-devel] Fwd: fix for AIX bug?

Ton Voon tonvoon at mac.com
Thu Jan 6 15:08:03 CET 2005


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: 2677 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20050106/cb78a8ac/attachment.bin>


More information about the Devel mailing list