Page 1 of 2

Nagios 4 with Nagvis and Livestatus

Posted: Sun Jan 26, 2014 12:58 am
by rcraig114
I know there has been a lot of talk about compatibility issues with Nagios 4 and Livestatus (for nagvis), but so far the few fixes people have recommended have had me run into dead ends or in circles. Does anyone have a working fix for this? I've got to believe that the issue has been fixed by the livestatus people, but even after downloading the latest version (January of 2014), it's still generating

Error: Could not load module '/usr/local/lib/mk-livestatus/livestatus.o' -> /usr/local/lib/mk-livestatus/livestatus.o: undefined symbol: last_command_check

I've tried to use other products, but I can't figure out how to get the install to run. Some of this stuff is a little over my head. I don't want to have to resort to a SQL config via ndob, but maybe it's my only choice? Any help is appreciated.

Robert

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Jan 27, 2014 11:19 am
by abrist
You need to build livestatus from the op5 fork for a nagios core 4 compatible version:
https://github.com/op5/livestatus

Re: Nagios 4 with Nagvis and Livestatus

Posted: Fri Jan 31, 2014 9:21 pm
by rcraig114
Any guidance or how-to's on doing that? Ive seen only one or two examples using the Op5 version and haven't gotten anywhere. Thanks for anything you can give me.

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 11:05 am
by abrist
There should be directions at the bottom of the github account page:
https://github.com/op5/livestatus
=== INSTALL ===

To install, run:
autoreconf -s
automake --add-missing
./configure CPPFLAGS=-I$(path to nagios include files, usually /usr/local/nagios/include)
make
sudo make install

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 3:13 pm
by rcraig114
I've seen that before. Thats what I tried using but didn't get anywhere. For one, I don't have an "include" folder in my Nagio directory. Does the below syntax look correct?

autoreconf -s
automake --add-missing
./configure CPPFLAGS=-I$/usr/local/nagios
make
sudo make install

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 3:47 pm
by abrist
rcraig114 wrote:For one, I don't have an "include" folder in my Nagio directory.
The "include" folder requires the nagios core source and you will find the include folder in the source. The path to that folder is what you should use for the CPPFLAGS.

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 4:57 pm
by rcraig114
OK, I see. I still have the source from the initial install (/usr/src/nagios-4.0.2) and it does have an "include" folder in it. So, let me make sure I've got this correct. I need to download the op5 source. From within the source folder "livestatus", run the below commands?

autoreconf -s
automake --add-missing
./configure CPPFLAGS=-I$/usr/src/nagios-4.0.2/include
make
sudo make install

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 5:03 pm
by abrist
Yep. And just for clarification, you do not need the '$':

Code: Select all

./configure CPPFLAGS=-I/usr/src/nagios-4.0.2/include
I expect that the livestatus guys will apply the patches in the future, but for now, you have to use the op5 fork of livestatus to work with core 4.
Additionally, if linking the include folder does not work, you can always use a symlink or move the nagios source folder to the livestatus directory.

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 5:14 pm
by rcraig114
This is where I start to beat my head against the wall. The commands seem simple,but errors galore. See below.

[root@openvzhost1 livestatus]# autoreconf -s
configure.ac:32: required file `./install-sh' not found
configure.ac:32: `automake --add-missing' can install `install-sh'
configure.ac:32: required file `./missing' not found
configure.ac:32: `automake --add-missing' can install `missing'
src/Makefile.am:31: `livestatus.so' is not a standard library name
src/Makefile.am:31: did you mean `liblivestatus.a'?
src/Makefile.am: required file `./depcomp' not found
src/Makefile.am: `automake --add-missing' can install `depcomp'
autoreconf: automake failed with exit status: 1
[root@openvzhost1 livestatus]# ls
aclocal.m4 api AUTHORS autom4te.cache config.h.in configure configure.ac COPYING Makefile.am op5build README src
[root@openvzhost1 livestatus]# nano README
[root@openvzhost1 livestatus]# automake --add-missing
configure.ac:32: installing `./install-sh'
configure.ac:32: installing `./missing'
src/Makefile.am:31: `livestatus.so' is not a standard library name
src/Makefile.am:31: did you mean `liblivestatus.a'?
src/Makefile.am: installing `./depcomp'
[root@openvzhost1 livestatus]# ./configure CPPFLAGS=-I/usr/src/nagios-4.0.2/include
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for socket in -lsocket... no
checking for connect in -lsocket... no
checking for shutdown in -lsocket... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for int32_t... yes
checking for int64_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash... yes
checking whether stat accepts an empty string... no
checking for bzero... yes
checking for gettimeofday... yes
checking for memmove... yes
checking for regcomp... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strerror... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
[root@openvzhost1 livestatus]# make
make all-recursive
make[1]: Entering directory `/usr/src/livestatus'
Making all in src
make[2]: Entering directory `/usr/src/livestatus/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/src/nagios-4.0.2/include -fPIC -g -O2 -MT livestatus_so-AndingFilter.o -MD -MP -MF .deps/livestatus_so-AndingFilter.Tpo -c -o livestatus_so-AndingFilter.o `test -f 'AndingFilter.cc' || echo './'`AndingFilter.cc
In file included from Query.h:29,
from AndingFilter.cc:28:
nagios.h:31:28: error: nagios/objects.h: No such file or directory
nagios.h:32:27: error: nagios/nagios.h: No such file or directory
nagios.h:33:31: error: nagios/nebstructs.h: No such file or directory
nagios.h:34:30: error: nagios/neberrors.h: No such file or directory
nagios.h:35:27: error: nagios/broker.h: No such file or directory
nagios.h:36:31: error: nagios/nebmodules.h: No such file or directory
nagios.h:37:33: error: nagios/nebcallbacks.h: No such file or directory
In file included from AndingFilter.cc:28:
Query.h:66: error: ISO C++ forbids declaration of âcontactâ with no type
Query.h:66: error: expected â;â before â*â token
Query.h:112: error: ISO C++ forbids declaration of âcontactâ with no type
Query.h:112: error: expected â;â before â*â token
Query.h:113: error: expected â;â before âvoidâ
make[2]: *** [livestatus_so-AndingFilter.o] Error 1
make[2]: Leaving directory `/usr/src/livestatus/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/livestatus'
make: *** [all] Error 2
[root@openvzhost1 livestatus]#

Re: Nagios 4 with Nagvis and Livestatus

Posted: Mon Feb 03, 2014 5:23 pm
by abrist
wierd. It looks like it is looking for the includes in "./nagios" not includes. It may be easier to copy the whole dang nagios source folder to ./livestatus/nagios.
cd into the livestatus folder:

Code: Select all

cd <livestatus folder path>
mkdir nagios
cp -rv <nagios source folder>/includes/* <livestatus folder>/nagios
mkdir lib
cp -rv <nagios source folder>/lib/* <livestatus folder>/lib
And then try the install once again.
I took a look at my script that automates the install on centos and realized you need the lib directory as well.