check_pgsql in nagios-plugins-1.4.2

Hi,

I tried to compile from source nagios-plugins-1.4.2 with following steps -

  1. installed PostgreSQL 8.1.3 from source
  2. installed Nagios 2.0 from source
  3. run “./configure --with-pgsql=/usr/local/pgsql”
  4. run make

However, I am unable to get the check_pgsql plugin as expected. Appreciate any advice for the steps to follow to have the check_pgsql plugin installed.

Regards

When you compiled the plugins, it most likely complained about "missing … "
check your config.log
and search for pgsql and/or
libpq-fe.h
Oh, and you need the postgresql-devel package installed.

Appreciate your response.

Below is extracted from my config.log(which I suppose is relevant to the problem) -


configure:8971: WARNING: Skipping PostgreSQL plugin (check_pgsql)
configure:8973: WARNING: install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).

“/usr/lib/libcrypto*” was shown from running “find”.
“libpq-fe.h” is located in “/usr/local/pgsql/include”.

I supposed the required libraries and source files are available since the entire Postgresql was built from source. I had done it successfully with other softwares, Asterisk for example, that were dependent on pgsql libs.

I am not running Linux, which is part of the reason pgsql was built from source, and thus cannot install the postgresql-devel package.

Oh, OK, then you should have used this instead. Try it.
run “./configure --with-pgsql=/usr/local”

OH, and try using slocate instead of find. It’s faster.

Tried “./configure --with-pgsql=/usr/local”, still not getting check_pgsql. Earlier extract was shown in config.log.

I am using OpenBSD 3.8, doesn’t come with slocate, would try installing later. Thanks for the advice.

ok, then try editting your /etc/ld.so.conf and make sure it has /usr/local in it. If not, and you add it, then you have to run
ldconfig
after you made the change. Then rerun ./configure

OpenBSD does not use ld.so.conf as well :slight_smile:

Tried “export LD_LIBRARY_PATH=/usr/local” but failed.

I looked at config.log again and noticed the extract below -


configure:8366: gcc -o conftest -g -O2 -L. conftest.c -lcrypt >&5
/usr/bin/ld: cannot find -lcrypt
collect2: ld returned 1 exit status
configure:8372: $? = 1
configure: failed program was:
| /* confdefs.h. /
|
| #define PACKAGE_NAME “nagios-plugins”
| #define PACKAGE_TARNAME “nagios-plugins”
| #define PACKAGE_VERSION “1.4.2”
| #define PACKAGE_STRING “nagios-plugins 1.4.2”
| #define PACKAGE_BUGREPORT “”
| #define PACKAGE “nagios-plugins”
| #define VERSION “1.4.2”
| #define _GNU_SOURCE 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_UNISTD_H 1
| #define EXTENSIONS 1
| #define HAVE_STDLIB_H 1
| #define HAVE_MALLOC 1
| #define HAVE_STDLIB_H 1
| #define HAVE_REALLOC 1
| #define HAVE_GETLOADAVG 1
| #define CGIURL “/nagios/cgi-bin”
| /
end confdefs.h. */
|
|
| int
| main ()
| {
| main ();
| ;
| return 0;
| }
configure:8398: result: no
configure:8971: WARNING: Skipping PostgreSQL plugin (check_pgsql)
configure:8973: WARNING: install lib crypt and PostgreSQL libs to compile this plugin (see REQUIREMENTS).


I checked the ./configure as well, guessed the “-lcrypt” argument was not fulfilled, which led to pgsql being skipped. Thus, it was not even allowed to go further to check for pgsql libs.

As stated in http://www.openbsd.org/porting.html -

“OpenBSD does NOT require -lcrypt.
DES encryption is part of the standard libc.”

Probably some modification can be made to the source to provide for this.

Removed all “-lcrypt” occurence from ./configure. Compiled, installed and tested check_pgsql. Worked w/o error, but can anyone verify that I am taking the correct steps?