Icinga Installation Troubles — Just Like Nagios?

At work, „we“ have decided to start monitoring availability of our servers and services. To do this, I decided to try out Nagios and soon found the fork Icinga, which looks rather promising.

Before I actually did any „real“ work, I Googled and found that some people claimed, that it installs/compiles without too much hassle. Not so for me, though😦

So I first downloaded the now current version of Icinga, v.0.8.4 and unpacked it:

wget http://downloads.sourceforge.net/project/icinga/icinga/0.8.4/icinga-0.8.4.tar.gz?use_mirror=surfnet
zcat icinga-0.8.4.tar.gz | tar xf -

Trying to compile Icinga using Sun Studio 12 Update 1.

cd icinga-0.8.4
CC=/opt/sunstudio12.1/bin/cc ~+/configure --prefix=$HOME/.software/icinga-0.8.4
LC_ALL=C CC=/opt/sunstudio12.1/bin/cc make all

And that’s where it fails for the 1st time😦

--($ ~/src/icinga-0.8.4)-- LC_ALL=C CC=/opt/sunstudio12.1/bin/cc make all
cd ./base && make
/opt/sunstudio12.1/bin/cc -g -DHAVE_CONFIG_H -DNSCORE  -c  ../common/snprintf.c
"../common/snprintf.c", line 273: warning: initializer will be sign-extended: -1
/opt/sunstudio12.1/bin/cc -g -DHAVE_CONFIG_H -DNSCORE -o icinga icinga.c broker.o nebmods.o checks.o config.o commands.o events.o flapping.o logging.o macros-base.o netutils.o notifications.o sehandlers.o skiplist.o utils.o retention-base.o xretention-base.o comments-base.o xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o xdowntime-base.o  ../common/snprintf.o     -lm -lnsl -lsocket -lpthread -ldl -lrt
"icinga.c", line 650: warning: implicit function declaration: asprintf
ld: fatal: file ../common/snprintf.o: open failed: No such file or directory
ld: fatal: File processing errors. No output written to icinga
*** Error code 1
make: Fatal error: Command failed for target `icinga'
Current working directory /export/home/webservd/src/icinga-0.8.4/base
*** Error code 1
make: Fatal error: Command failed for target `all'

„Okay“, that’s the error: ld: fatal: file ../common/snprintf.o: open failed: No such file or directory. This was rather easily cured with an old hint found on the nagios-users mailinglist.

--($ ~/src/icinga-0.8.4)-- ln -s ../base/snprintf.o common/snprintf.o
--($ ~/src/icinga-0.8.4)-- LC_ALL=C CC=/opt/sunstudio12.1/bin/cc make all
[...]

Nice. It got past that step.😉 But „of course“, that’s not all…

--($ ~/src/icinga-0.8.4)-- LC_ALL=C CC=/opt/sunstudio12.1/bin/cc make all
cd ./base && make
cd ./cgi && make
cd ./html && make
if [ xyes = xyes ]; then \
 cd ./module && make; \
fi
/opt/sunstudio12.1/bin/cc  -g -DHAVE_CONFIG_H -o helloworld.o helloworld.c -G  -lrt
"helloworld.c", line 39: warning: syntax error:  empty declaration
ld: fatal: file helloworld.o: unknown file type
ld: fatal: File processing errors. No output written to helloworld.o
*** Error code 1
make: Fatal error: Command failed for target `helloworld.o'
Current working directory /export/home/webservd/src/icinga-0.8.4/module
*** Error code 1
make: Fatal error: Command failed for target `all'

Aha. Again the nagios-users archive proved to be helpful🙂 Per that mail, I modified module/Makefile, resulting in the following diff/patch:

--($ ~/src/icinga-0.8.4)-- diff -u module/Makefile.original module/Makefile
--- module/Makefile.original    Mi Sep 23 13:03:27 2009
+++ module/Makefile     Mi Sep 23 13:04:45 2009
@@ -25,13 +25,13 @@

 CP=@CP@

-all:   helloworld.o
+all:   helloworld

-helloworld.o: helloworld.c
-       $(CC) $(MOD_CFLAGS) $(CFLAGS) -o helloworld.o helloworld.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS)
+helloworld: helloworld.c
+       $(CC) $(MOD_CFLAGS) $(CFLAGS) -o helloworld helloworld.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS)

 clean:
-       rm -f helloworld.o
+       rm -f helloworld
 rm -f core *.o
 rm -f *~ *.*~

(Thanks to WordPress, that’s of course not something you can feed to patch(1) ­).

Update:

On the nagios-devel mailing list, there’s a different solution to this problem:

My workaround (and probably the right fix):
---snip---
vi include/nagios.h
goto line 491
change
int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void
*,void *,int);        /* schedules a new timed event */
to
int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void
(*)(char *),void *,int);        /* schedules a new timed event */

vi include/nebmodules.h
search
#define NEB_API_VERSION(x) int __neb_api_version = x;
change to (remove the semicolon at the end)
#define NEB_API_VERSION(x) int __neb_api_version = x

perl -pi -e 's:helloworld.o:helloworld:g' module/Makefile*
---snip---

Haven’t tried it, just writing it down here, so I can (maybe… *G*) find it later on.

Having done that, it compiles just fine!

--($ ~/src/icinga-0.8.4)-- LC_ALL=C CC=/opt/sunstudio12.1/bin/cc make all
cd ./base && make
cd ./cgi && make
cd ./html && make
if [ xyes = xyes ]; then \
 cd ./module && make; \
fi
/opt/sunstudio12.1/bin/cc  -g -DHAVE_CONFIG_H -o helloworld helloworld.c -G  -lrt
"helloworld.c", line 39: warning: syntax error:  empty declaration

*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Icinga as follows (type 'make'
without any arguments for a list of all possible options):

 make install
 - This installs the main program, CGIs, and HTML files

 make install-init
 - This installs the init script in /etc/init.d

 make install-commandmode
 - This installs and configures permissions on the
 directory for holding the external command file

 make install-idoutils
 - This installs the database addon IDOUtils into the
 destination directory

 make install-config
 - This installs *SAMPLE* config files in /export/home/webservd/.software/icinga-0.8.4/etc
 You'll have to modify these sample files before you can
 use Icinga.  Read the HTML documentation for more info
 on doing this.  Pay particular attention to the docs on
 object configuration files, as they determine what/how
 things get monitored!

 make install-webconf
 - This installs the Apache config file for the Icinga
 web interface

*** Support Notes *******************************************

If you have questions about configuring or running Icinga,
please make sure that you:

 - Look at the sample config files
 - Read the HTML documentation in html/docs/

before you post a question to one of the mailing lists at
http://www.icinga.org/community/ or at Icinga Portal:
http://www.icinga-portal.org

Also make sure to include pertinent information that could
help others help you.  This might include:

 - What version of Icinga you are using
 - What version of the plugins you are using
 - Relevant snippets from your config files
 - Relevant error messages from the Icinga log file

For more information on obtaining support for Icinga, visit:

 http://www.icinga.org/community/

*************************************************************

Enjoy.

Excellent!

But somehow I get the feeling, that this is just the beginning…🙂

4 thoughts on “Icinga Installation Troubles — Just Like Nagios?

  1. Pingback: Core Dumps when run in SMF, fine otherwise‽ « Es ist ein Fehler aufgetreten…

  2. Pingback: Installing Nagios « Es ist ein Fehler aufgetreten…

  3. Pingback: Installing Nagios / Icinga « Es ist ein Fehler aufgetreten…

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s