| Summary: | nagios fails to compile postgresql support | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Thomas Beutin <tb> |
| Component: | Current packages | Assignee: | Gentoo Netmon project <netmon> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | esigra |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
Thomas Beutin
2004-03-24 09:39:17 UTC
What version of postgresql do you have installed? The installed PostgreSQL version is: PostgreSQL 7.3.6 on i486-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) What I was asking was what portage version postgresql? My installed postgres version is:
* dev-db/postgresql
Latest version available: 7.3.6
Latest version installed: 7.3.6
Size of downloaded files: 8,130 kB
Homepage: http://www.postgresql.org/
Description: sophisticated Object-Relational DBMS
License: POSTGRESQL
Sorry for misunderstanding!
I found a solution that appears to work, using
sys-apps/portage-2.0.50-r5
dev-db/postgresql-7.3.6
net-analyzer/nagios-core-1.2
1) Edit the nagios-core-1.2.ebuild
2) Change the postgres section as follows (bottommost line is the change):
use postgres && myconf="${myconf} \
--with-pgsql-xdata \
--with-pgsql-status \
--with-pgsql-comments \
--with-pgsql-extinfo \
--with-pgsql-retention \
--with-pgsql-downtime \
--with-pgsql-inc=/usr/include/postgresql"
This may not be the best way to go about fixing this problem, but it does compile without errors.
I had run into the exact same problem trying to emerge nagios-core-1.1-r4, and may apply to it as well.
Thanks for suggestion, it works for me and the 1.1-r4, but this is a crude hack for the elegant emerge system yes, after experiencing the same problem, I investigated and it is clear that the issue is that nagios isn't adding -I/usr/include/postgresql to the compiler flags. Well, the nagios configure script doesn't even try to locate the include dir. for mysql, this is no problem because the .h files are under /usr/include/mysql and are included as <mysql/someheader.h>. pgsql headers are included as <pgsql/someheader.h> but it is /usr/include/postgresql/pgsql/someheader.h... It is inevitable to add --with-pgsql-inc=/usr/include/postgresql (but only if the pgsql headers are located like this) also, I hard coded it because pg_config doesn't behave like it should (bug 56091). in portage (nagios-core-1.2-r1). "../xdata/xrddb.c:46:28: pgsql/libpq-fe.h: No such file or directory" AFAIK (after digging into the postgresql mailing list archives) this is wrong, they sould include the libpq-fe.h in the directory reported from the output of "pg_config --includedir" (yes, there are to identical libpq-fe.h below /usr/include; the same applies to postgres_ext.h, but this is found three times below /usr/include). Thomas, do you still get compile errors because of this, or is this issue solved with the latest ebuild? btw, it wouldn't matter what pg_config would report, because nagios' configure script doesn't consult it. I would ask for nagios' developers to include a check for it, but first I need pg_config to be honest. This issue is solved with the last ebuild, thanx a lot to all! It compiles fine. But i think to solve the problem "smooth" the nagios team should change the include from #include <pgsql/libpq-fe.h> to #include <libpq-fe.h> and adding -I[output from pg_config --includedir] to the compiler flags. I agree. But as I said in an earlier comment, this relies on bug 56091 to be solved first. |