statusmap.cgi compiled on Solaris

Richard Gillman R.Gillman at nerc.ac.uk
Wed Mar 31 17:55:50 CEST 2004


I had a lot of trouble getting statusmap.cgi to work on a Solaris box. 
To save others the time it took me, here is how I did it.

In short, forget about existing versions of libraries, download png and 
gd, and install them, png first, then gd, into /usr/local/nagios/lib, 
and /usr/local/nagios/include.

In detail...

1. libpng and libgd

My first attempts to run nagios resulted in difficulties with the 
statusmap.cgi executable.  The messages

libpng warning: Application was compiled with png.h from libpng-1.0.7
libpng warning: Application  is  running with png.c from libpng-1.2.1
gd-png:  fatal libpng error: Incompatible libpng version in application 
and library
[Wed Mar 31 11:12:45 2004] [error] [client 192.171.172.61] Premature end 
of script headers: /usr/local/nagios/sbin/statusmap.cgi

were appearing in apache error log.

It turned out the “Incompatible libpng version in application and 
library” message was being generated within libpng, and “gd-png:  fatal 
libpng error:” within libgd. gd was calling a version of png (I could 
see this with ldd) which had some internal incompatibility. To overcome 
this without destabilising the existing libraries, iI decided recompile 
png, placing it in /usr/local/nagios/lib (and include), and to recompile 
gd, using the /usr/local/nagios/ version of png in preference to any other.

To compile png,

cp scripts/makefile.solaris makefile
Edit makefile; change the following lines

prefix=/usr/local/nagios
ZLIBLIB=/nerc/packages/utilities/lib
ZLIBINC=/nerc/packages/utilities/include

make; make install

To compile gd,

setenv LDFLAGS "-L/usr/local/nagios/lib -L/nerc/packages/utilities/lib 
-L/usr/lib -L/nerc/packages/gcc/3.2.2/lib -R/usr/local/nagios/lib 
-R/nerc/packages/utilities/lib -R/usr/lib -R/nerc/packages/gcc/3.2.2/lib"
setenv CPPFLAGS "-I/usr/local/nagios/include 
-I/nerc/packages/utilities/include -I/usr/include 
-I/nerc/packages/gcc/3.2.2/include"
setenv LD_LIBRARY_PATH 
"/usr/local/nagios/lib:/nerc/packages/utilities/lib:/usr/lib:/nerc/packages/gcc/3.2.2/lib"
setenv LD_RUN_PATH 
"/usr/local/nagios/lib:/nerc/packages/utilities/lib:/usr/lib:/nerc/packages/gcc/3.2.2/lib"
configure --prefix=/usr/local/nagios 
--with-png-lib=/usr/local/nagios/lib --without-freetype --without-xpm
make
make install

Before the first make, I needed to edit the generated libtool file to 
give the full path of ranlib (usr/ccs/bin/ranlib).

Dick
-- 
Richard Gillman
iTSS UNIX Systems Group, Maclean Building, Wallingford OX10 8BB
Tel: 01491 - 692 339



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
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