[Nagiosplug-devel] [ nagiosplug-Bugs-1093522 ] 1.4beta1 check_swap doesn't work on AIX

SourceForge.net noreply at sourceforge.net
Wed Jan 19 13:17:45 UTC 2005


Bugs item #1093522, was opened at 2004-12-30 23:20
Message generated for change (Comment added) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1093522&group_id=29880

Category: None
Group: Release (specify)
>Status: Pending
Resolution: None
Priority: 5
Submitted By: mister_patient (mister_patient)
Assigned to: Ton Voon (tonvoon)
Summary: 1.4beta1 check_swap doesn't work on AIX

Initial Comment:
The 1.4beta1 check_swap module doesn't work on AIX 5.2:

$ lsps -s
Total Paging Space   Percent Used
      4096MB              42%

$  ./check_swap -w 20% -c 10% -v -v -v
Command: /usr/sbin/lsps -s
Format: %d%*s %d
total=4096, used=0, free=0
SWAP OK: 100% free (17592186044416 MB out of
17592186044416 MB) |swap=0MB;2147483647;2147483647;0;0



----------------------------------------------------------------------

>Comment By: Ton Voon (tonvoon)
Date: 2005-01-19 21:16

Message:
Logged In: YES 
user_id=664364

Yup, missed that one. Applied to CVS now. Marking this call to pending to 
auto close.

BTW, what is your real name to add to our contributors list.

----------------------------------------------------------------------

Comment By: mister_patient (mister_patient)
Date: 2005-01-19 15:37

Message:
Logged In: YES 
user_id=1187596

If I change line 139 of check_swap.c from:

asprintf(&swap_format, "%s", "%d%*s %d");

to

asprintf(&swap_format, "%s", "%f%*s %f");

it works fine.

----------------------------------------------------------------------

Comment By: mister_patient (mister_patient)
Date: 2005-01-19 14:22

Message:
Logged In: YES 
user_id=1187596

The revised check_swap code using the floats does not work
on AIX 5.2.  Here's the output:

$ lsps -s
Total Paging Space   Percent Used
      4096MB              54%

$ ./check_swap -v -v -w 20% -c 10%
Command: /usr/sbin/lsps -s
SWAP OK: 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0

If I get time, I will experiment to see where the problem lies.



----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2005-01-13 18:29

Message:
Logged In: YES 
user_id=664364

Using float values only. Tested on Sol2.6. Can you please try 
this and let us know how it goes on your systems please.

It looks like there is a slight bug in the perf data output, but 
it seems to be only a rounding error. 

----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2005-01-06 23:16

Message:
Logged In: YES 
user_id=664364

My preferred solution would be to remove the use of unsigned long long 
and just use float variables, but I'm a bit reticent about this. Sent email 
to nagiosplug-devel to gather some opinions first.

----------------------------------------------------------------------

Comment By: mister_patient (mister_patient)
Date: 2005-01-06 21:55

Message:
Logged In: YES 
user_id=1187596

I am not a developer, so please take this with a grain of
salt, but the issue appears to be that AIX doesn't like the
fact that a bunch of variables are declared as unsigned long
longs.  If I change this:

unsigned long long total_swap = 0, used_swap = 0, free_swap = 0;
unsigned long long dsktotal = 0, dskused = 0, dskfree = 0,
tmp = 0;

to this:

unsigned long total_swap = 0, used_swap = 0, free_swap = 0;
unsigned long dsktotal = 0, dskused = 0, dskfree = 0, tmp = 0;

it seems to work OK (although you also have to clean up some
of the printfs to use %lu instead of %llu).

As I say, I am not a programmer, so I do not know if there
is an elegant way to fix this.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1093522&group_id=29880




More information about the Nagiosplugin-devel mailing list