<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial>
<DIV><SPAN class=984500518-14092004><FONT size=2>Hi, folks.</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>Installing
nagios-plugins-1.4.0a1 on AIX 5.1 ML04, I've found that it's neccessary to
configure the compilation with:</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>CFLAGS="-g -O2 -maix64"
OBJECT_MODE=32_64 ./configure</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>Otherwise, check_disk will lock
up and will not return even when run without options. I've found that the
problem is at lib/mountlist.c around line 723:</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>for (thisent = entries; thisent
< entries + bufsize;<BR>
thisent += vmp->vmt_length)</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>After doing a little research
on Google, I found that vmount as defined in <sys/vmount.h> has a variable
type definition:</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>struct vmount
{<BR> uint
vmt_revision; /* I revision level, currently
1
*/<BR> uint
vmt_length; /* I total length of structure and data
*/<BR>#if !defined(_KERNEL) &&
defined(__64BIT__)<BR> fsid64_t
vmt_fsid; /* O id of file
system
*/<BR>#else<BR> fsid_t
vmt_fsid; /* O id of file
system
*/<BR>#endif<BR>(...)</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>When compiled in 32-bit mode in
an AIX 64-bit machine/os, vmt_length turns out to be zero at some point - this
is because vmt_fsid is 64-bit and this is not taken into account by the plugin
and <SPAN class=421174018-14092004>its</SPAN> lower-order bits are thrown
out. After this point, thisent is not increased and we get a infinite
loop.</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>The solution is to use -maix64.
According to gcc manual:</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><!--StartFragment --><FONT face=Arial
size=2>"Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
<CODE>long</CODE> type, and the infrastructure needed to support them.
Specifying <CODE>-maix64</CODE> implies <CODE>-mpowerpc64</CODE> and
<CODE>-mpowerpc</CODE>, while <CODE>-maix32</CODE> disables the 64-bit ABI and
implies <CODE>-mno-powerpc64</CODE>. GCC defaults to
<CODE>-maix32</CODE>."</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>Thus, with maix64 we compare
again apples to apples, and check_disk works without a
hitch.</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2>I don't know <SPAN
class=421174018-14092004>now </SPAN>what is easier:</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT size=2></FONT></SPAN> </DIV>
<OL>
<LI><FONT size=2><SPAN class=984500518-14092004>Modify ./configure to add
-maix64 <SPAN class=421174018-14092004>to CFLAGS whem using gcc
</SPAN><SPAN class=421174018-14092004>(and its xlC counterpart) </SPAN>when it
knows that is running on a 64-bit machine;</SPAN> </FONT>
<LI><SPAN class=984500518-14092004><FONT size=2>Modify lib/mountlist.c to
handle both situations.</FONT></SPAN></LI></OL>
<DIV><SPAN class=984500518-14092004><FONT size=2>[]'s</FONT></SPAN></DIV>
<DIV><SPAN class=984500518-14092004><FONT
size=2>Paulo</FONT></SPAN></DIV></FONT></DIV>
<DIV> </DIV>
<DIV align=left><FONT face=v size=2><STRONG>Paulo Afonso Graner
Fessel</STRONG></FONT></DIV>
<DIV align=left><EM><FONT size=1>Administrador de Ambiente e Sistemas
UNIX</FONT></EM></DIV>
<DIV align=left><FONT size=1>
<DIV align=left><FONT size=1><A
href="mailto:paulo.fessel@primesys.com.br">paulo.fessel@primesys.com.br</A></FONT></DIV>OWT</FONT></DIV>
<DIV align=left><FONT size=1>Fone: +55 (11) 3038-6554</FONT></DIV>
<DIV align=left><FONT size=1>Fax: +55 (11) 3038-6508</FONT></DIV>
<DIV align=left><FONT size=1><A
href="http://www.primesys.com.br/">http://www.primesys.com.br</A></FONT></DIV>
<DIV align=left> </DIV>
<DIV align=left><IMG id=_x0000_i1025 height=67 src="cid:421174018@14092004-2D78"
width=110 border=0></DIV>
<DIV align=left> </DIV>
<DIV> </DIV></BODY></HTML>