Page 1 of 1

Mac OS X Leopard | Nagios Core 4.3.4 | Installation issue

Posted: Thu Sep 14, 2017 3:11 am
by prakriti
Hi All,

I am new to Mac OS X. I am trying to install nagios core from source on my server but facing issues while compiling.

Nagios core source: https://github.com/NagiosEnterprises/na ... 3.4.tar.gz

./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/opt/local/lib --with-gd-inc=/opt/local/include --prefix=/usr/local/nagios-core worked fine.

I am getting below error by when I run make all:

cd ./worker && make all
cd ./ping && make all
gcc -I.. -I ../../include -I ../.. -g -O2 -I/opt/local/include -DHAVE_CONFIG_H -o worker-ping worker-ping.c -L ../../lib -l nagios -L/opt/local/lib
ld: library not found for -lnagios
collect2: ld returned 1 exit status
make[2]: *** [worker-ping] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2

libnagios.h and libnagios.a exist at nagios-4.2.0/lib location

Is there something I am missing? Any help I can get here will be appreciated. Thanks in advance.

Re: Mac OS X Leopard | Nagios Core 4.3.4 | Installation issu

Posted: Thu Sep 14, 2017 12:49 pm
by kyang
hi @prakriti,

Did you install the Prerequisites?

What documentation did you follow when installing Nagios Core? Make sure to download Xcode and other prerequisites.

https://support.nagios.com/kb/article/n ... Apple_OS_X

Let me know how you did your installation

Re: Mac OS X Leopard | Nagios Core 4.3.4 | Installation issu

Posted: Thu Sep 14, 2017 12:56 pm
by npolovenko
@prakriti The easiest way to have Nagios Core running on your OSX is to spin up a virtual machine with the pre compiled OVA. You can download it from here: https://www.nagios.org/downloads/nagios-core/

Re: Mac OS X Leopard | Nagios Core 4.3.4 | Installation issu

Posted: Fri Sep 15, 2017 2:46 am
by prakriti
Thanks @kyang and @npolovenko for a quick reply.
I followed the same document for installation.

I have installed Xcode 3.1.4, Mac ports and the pre-requisites

port install zlib libpng jpeg gd2 php70 php70-apache2handler (apache2 was already present)

/usr/bin/xcodebuild -version
Xcode 3.1.4
Component versions: DevToolsCore-1204.0; DevToolsSupport-1186.0
BuildVersion: 9M2809

Today, I tried brew install libgd (which added dependencies for gd: xz, pkg-config, libpng, freetype, fontconfig, jpeg ,lib-tiff)
and changed my configure command as:

./configure --with-httpd-conf=/opt/local/apache2/conf/extra --with-gd-lib=/usr/local/Cellar/gd/2.1.1/lib --with-gd-inc=/usr/local/Cellar/gd/2.1.1/include --prefix=/usr/local/nagios-core

Issue remains same:
cd ./worker && make all
cd ./ping && make all
gcc -I.. -I ../../include -I ../.. -g -O2 -I/usr/local/Cellar/gd/2.1.1/include -DHAVE_CONFIG_H -o worker-ping worker-ping.c -L ../../lib -l nagios -L/usr/local/Cellar/gd/2.1.1/lib
ld: library not found for -lnagios
collect2: ld returned 1 exit status
make[2]: *** [worker-ping] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2



Source files used:
1.) https://github.com/NagiosEnterprises/na ... 3.4.tar.gz
2.) https://assets.nagios.com/downloads/nag ... 1504670252 (@npolovenko the link shared by you)

Issue is same with both source files. I guess I am missing some dependency. Is there anything else that needs to be installed?

Note: brew was run with a normal user and everything else as sudo

Re: Mac OS X Leopard | Nagios Core 4.3.4 | Installation issu

Posted: Fri Sep 15, 2017 3:21 pm
by dwhitfield
We don't have very many macs here for testing. I would advise setting up a VM and installing CentOS, as that is what we deal with the most. Instructions for CentOS installs at https://support.nagios.com/kb/article/n ... tml#CentOS