Compiling

To compile the plugins, you run:

gunzip -c nagios-plugins-1.4.10.tar.gz | tar -xf -
cd nagios-plugins-1.4.10
./configure
make

./configure appears to hang

If you find that the configure script appears to hang on this line:


checking for redhat spopen problem...

Then you probably have a badly configured DNS server. This part of configure is testing for a pthread problem in Bind that is a kernel problem on some Red Hat derived versions of Linux (around kernel 2.6.9-11). It runs 10 x 100 nslookup calls to see if your kernel has this problem. If it does, then at least 1 of those calls will fail. Failure rate could be anywhere between 1% and 50%.

To force the workaround and ignore the test, run ./configure with the --enable-redhat-pthread-workaround switch.

check_ldap, check_radius or check_pgsql don't compile even though configure output says the required libraries are present

Due to a bug in the 1.4.7 and 1.4.8 releases, check_ldap, check_radius and check_pgsql won''t compile if MySQL libs are present even if configure output says the required libraries are present. This is fixed in 1.4.9

Here's the easiest way to compile and install these plugins:

  • cd to the plugins/ directory of the Nagios-plugins source tree
  • For each missing plugin, run "make check_", eg //$ make check_ldap//
  • Copy all pugins built above to your Nagios plugins directory (usually /usr/local/nagios/libexec/).

How come check_http/check_tcp doesn't work with --ssl?

To get the SSL features, you need to have the SSL libraries available. Either OpenSSL or GNUTLS is suitable.

Check the ./configure output to see if the SSL libraries have been detected.

How do I compile the Nagios::Plugin perl module?

This is currently an optional setting at configure time. You need to run:


./configure --enable-perl-modules

Then, make, make install, make test, and make clean, will include the perl modules that are in the perlmods/ directory as expected.

The perl modules are installed into $prefix/perl.

I can't compile check_mysql on solaris

If you are using GCC and your MySQL version was compiled using Sun's C compiler (or the other way round), then it is likely that the configure options will fail as configure will run mysql_config to get the appropriate CFLAGS.

There are various options:

  • Disable check_mysql by running ./configure --without-mysql
  • Allow ./configure to finish, but manually amend plugins/Makefile and remove any non-GCC flags in MYSQLCFLAGS
  • Use Sun's C compiler to compile the plugins
  • Use a GCC compiled version of MySQL

I get '":types" is not exported by the Params::Validate module' when running tests

This is a known problem with the Nagios::Plugin perl module: http://rt.cpan.org//Ticket/Display.html?id=29339.

However, it is now fixed in Nagios::Plugin 0.21, which is distributed with Nagios Plugins 1.4.10.

Why does Solaris use pst3 for check_procs?

Solaris systems restrict the information that is available when you run ps. On other Unix systems, running ps will list you the entire arguments, but Solaris restricts the arguments to the first 64 characters at the kernel.

This is a problem if you need to access the arguments to find out a specific process (common for listing java programs).

/usr/ucb/ps does list the full arguments, but only for your own processes. If you are root, then running /usr/ucb/ps can get the full arguments for all processes. However, the columns for RSS and VSZ merge together when the values are too large and check_procs cannot pull the value out correctly.

The chosen approach is to create our own ps-like command, pst3. This outputs the required information in a known format for check_procs to parse. This is the default if you run ./configure on a Solaris system.

Because pst3 needs access to some kernel structures, it needs to be compiled in 32 and 64 bit modes.

If you are comfortable with the limitations, it is possible to use a Solaris ps command by specifying these options to ./configure:

--with-ps-command="/usr/bin/ps -eo 's uid pid ppid vsz rss pcpu etime
comm args'" \
--with-ps-format="%s %d %d %d %d %d %f %s %s %n" \
--with-ps-cols=10 \
--with-ps-varlist="procstat,&procuid,&procpid,&procppid,\
&procvsz,&procrss,&procpcpu,procetime,procprog,&pos"

(The with-ps-varlist should be on one line - separated here for readability).