Building Nagios 1.2 on FreeBSD 5.2.1
Bruce Nunn
bnunn at loyno.edu
Sun Oct 24 04:33:11 CEST 2004
I found that using the FreeBSD ports collection to get Nagios 1.2
installed on FreeBSD 5.2.1 left me with a aspects which did not match the
Nagios documentation.
1) User and $HOME was /usr/local/nagios, but cgis, nagios binary and base
Nagios 1.2 stuff was installed in /usr/local/share/nagios.
2) Since CGIs were compiled with default prefix as per Nagios
documentation, I had to create simbolic link /usr/local/nagios to
/usr/local/share/nagios and put in "allow FollowSymLinks" in Apache
directory entry to get .cgis to work.
3) Nagios plugins were installed in /usr/local/libexec/nagios rather than
/usr/local/nagios/libexec. Hacking up nagios.cfg files made this work.
4) The ps command, which is compiled into the check_status plugin assumed
the output of GNU "ps -ef" not "ps -ax" so I had to hack up the cgi.cfg
file to look for some arbitrary root process. This was to I did not get
the dang "Nagios does not appear to be running" message rather than the
web page. It left me with incorrect status information on the "tactical
overview" web page, though.
Later on, I succeeded in building the base distrbution and plugins from
scratch and all the problems were solved such that my installation now
matched the Nagios 1.2 documentation. But I had to do a few things a bit
different from the documented ./configure, make all, make install
procedure. Below are the notes I made so I can build it again on my box. I
did not use the FreeBSD ports collection to install mysql or the GD
libraries. On my box, I had trouble with the GD libraries and MRTG with
the ports collection in the past, so it's installed from source too.
-------
The distro is built for linux and just seems to read the GNU .elf ld linker
stuff. So
1) create an /etc/ld.so.conf with the library paths and copy it to
/etc/ld-elf.so.conf
2) as root, run ldconfig
3) Unpack the nagios distro as per it's documentation and run this configure
script. It worked on my netmon.loyno.edu box anyway.
./configure --with-mysql-xdata --with-mysql-status --with-mysql-comments \
--with-mysql-extinfo --with-mysql-retention --with-mysql-downtime \
--with-mysql-lib=Path_to_mysql_libraries \
--with-mysql-include=Path_to_mysql_include_files \
--with-gd-lib=Path_to_gd_libraries \
--with-gd-include=Path_to_gd_include_files
4) Make sure the configure script found the proper mysql libraries and
gd libraries.
5) Hack up these files in the distro archive to put the paths to the mysql
and gd header files.
xdata/xdddb.c
xdata/xsddb.c
xdata/xcddb.c
xdata/xrddb.c
xdata/xeddb.c
You need to find "mysql.h" and "errmsg.h" at the top of the files and
put in the absolute path to these header files.
6) Hack up these files in the distro archive to put the paths to the gd
header files.
cgi/statusmap.c
cgi/trends.c
cgi/histogram.c
You need to find "gd.h" and "gdfonts.h" at the top of the files and
put in the absolute path to these header files.
7) do a "make all" as per the nagios documentation.
Nagios Plugin Notes
Again, even though the configure script gets the arguments you pass it,
some paths do not get passed on to the makefile.
1) For the check_mysql plugin, configure with this command.
./configure --with-mysql=Path_to_mysql_installation
2) Change to the distro archive plugins directory and hack up
check_mysql.c. Put in the absolute path to "mysql.h" and "errmsg.h".
3) do a "make all" as per the nagios documentation.
--
Bruce Nunn
Loyola University
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
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