Compling Nagios with MySQL on RH 8.0 issues

Joseph Burch jbb at virginia.edu
Fri Jun 13 15:38:30 CEST 2003


James -

I ran into the problem compiling nagios 1.1  using the native C compiler on under AIX
4.3.3, patch level 11.

In the xdata directory several files have "ifdefs" of the following form

#ifdef USE_XCDMYSQL
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
#endif

Angle brackets tell the pre-processor to look for the file in the "standard library" -- in
the old days /usr/lib.  This conflicts with the
"--with-mysql-lib=/usr/local/mysql/lib" config option.

To fix this, locate the MYSQL conditional defines in xcddb.c  xdddb.c xeddb.c  xrddb.c
xsddb.c and change the include statements to:

#include "mysql.h"
#include "errmsg.h"

My build (with GD extensions) referenced the "floor" function which required the usual
"-lm" loader option to be appended to LDFLAGS.  If you need GD,  either modify the
configure script or append in the makefiles AFTER you have run configure.

The same considerations apply to the POSTGRESQL build.  "<>" don't work unless the mysql
or postgres  header files have been placed in the standard lib.

Good Luck,

Joe


James Turnbull wrote:

> James Turnbull wrote:
> > Whilst compiling Nagios 1.1 under Redhat 8 (MySQL 4.0.13 Standard)
> > with the
> > following configure:
> >
> > ./configure --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios
> > --with-nagio s-user=nagios --with-nagios-grp=nagios
> > --with-mysql-xdata --with-mysql-lib=/ usr/local/mysql/lib
> > --with-mysql-inc=/usr/local/mysql/include
> >
> > The configure works fine but when I run make all I get the errors
> > below (note I have confimed mysql.h and errmsg.h are both present in
> > /usr/local/mysql/include/) - I am presuming the xrddb.c code is
> > looking in
> > the wrong place for these?  Of course I could be totally wrong.
> >
> > ../xdata/xrddb.c:41:25: mysql/mysql.h: No such file or directory
> > ../xdata/xrddb.c:42:26: mysql/errmsg.h: No such file or directory
>
> Hi I posted this a few days ago and got no response - I have searched the
> archives and found about half a dozen people reporting the same 'make all'
> problem as me - and no record of any resolution.
>
> Is there anyone out there who has overcome this problem or has any ideas?
>
> Any help much appreciated
>
> Regards
>
> James Turnbull
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: eBay
> Great deals on office technology -- on eBay now! Click here:
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list