TurnKey Linux Virtual Appliance Library

TKLPatch for Icinga (Nagios Fork)

John's picture

Is there a FAQ for formatting the text? :/ Refer to attached txt till i figure out this forum. [text now added as post]... OK.. there is a part of the forum without the formatting help... 

Hi, as i'm using your appliances since a while, i thought i should give you a big thanks for your work and a little patch i worked out for testing purposes.
The conf is kinda edgy but i'm still no programmer :>

So, what does it do?
Features:

  • Latest Version of Icinga from Git
  • Nagios-Plugins 1.4.15
  • Idoutils (Mysql Backend)

This Patch is intended for the Core-Appliance. (Hardy & Lucid)

First, it sets the hostname to Icinga:

HOSTNAME=icinga
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts
hostname $HOSTNAME

In the Second step it does an apt-get update + install:

install apache2 mysql-server build-essential libgd2-xpm-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev libdbi0 libdbi0-dev libdbd-mysql git-core

Then it creates the Users and Groups that are required:

echo 'Creating Icinga-User and Groups'
/usr/sbin/useradd -m icinga
passwd icinga < /tmp/passwd
/usr/sbin/groupadd icinga-cmd
/usr/sbin/usermod -a -G icinga-cmd icinga
/usr/sbin/usermod -a -G icinga-cmd www-data

Then its about to get the sources:

echo 'Getting Sources'
cd /usr/src
git clone git://git.icinga.org/icinga-core.git
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins...
tar xzf nagios-plugins-1.4.15.tar.gz
cd icinga-core

Then it configures and compiles Icinga:

./configure --with-command-group=icinga-cmd --enable-idoutils --enable-ssl
make
make all
make cgis
make install-cgis
make install-html
make install-webconf
make fullinstall

Then it alters the configs so that ido2db works:

#ido2db Config
cd /usr/local/icinga/etc/
mv ido2db.cfg-sample ido2db.cfg
mv idomod.cfg-sample idomod.cfg
sed -i "s/use_ssl=0/use_ssl=1/" ido2db.cfg idomod.cfg
sed -i "s/#socket_type=tcp/socket_type=tcp/" ido2db.cfg idomod.cfg
sed -i "s/socket_type=unix/#socket_type=unix/" ido2db.cfg idomod.cfg
sed -i "s/output_type=unixsocket/#output_type=unixsocket/" idomod.cfg
sed -i "s/#output_type=tcpsocket/output_type=tcpsocket/" idomod.cfg
sed -i "s@output=/usr/@#output=/usr/@" idomod.cfg
sed -i "s/#output=127.0.0.1/output=127.0.0.1/" idomod.cfg
sed -i "s/db_pass=icinga/db_pass=turnkey/" ido2db.cfg
sed -i "s@#broker_module=/usr/local/icinga/bin/idomod.o@broker_module=/usr/local/icinga/bin/idomod.o@" icinga.cfg

Then it generates the Database:

mysqladmin -u root password turnkey
dbpasswd=`cat /tmp/passwd-db`
/etc/init.d/mysql start
mysql -uroot -p$dbpasswd < /tmp/icinga-db
mysql -uroot -p$dbpasswd -D icinga < /usr/src/icinga-core/module/idoutils/db/mysql/mysql.sql

Compiling Nagios-Plugins:

cd /usr/src/nagios-plugins-1.4.15
./configure --prefix=/usr/local/icinga --with-nagios-user=icinga
make all
make install

Startup and Apache-Config, the config for apache is embedded so we dont have to point to http://localhost/icinga just to http://localhost/

update-rc.d ido2db defaults
update-rc.d icinga defaults
a2dissite default

The Rest is cleanup:

apt-get -y remove build-essential libgd2-xpm-dev libjpeg62-dev libpng12-dev libdbi0-dev
apt-get -y autoremove
rm -rf /usr/src/*

For Icinga Docs go here:
http://docs.icinga.org/latest/en/

Cfg-Files of Icinga are located at: /usr/local/icinga/etc

Web-Frontend: http://localhost/

I'll try to integrate NagiosQL when the new version is out. It's a Web-Config tool for Nagios/Icinga.

Maybe i'll do a Nagios-one with Ndoutils and Pnp4nagios integrated (a data grapher)

Attached: 
Jeremy's picture

Hi John, thanks for contributing!

I hope you don't mind but I took the liberty of editing your post and copy-pasting your text and formatting it.

As a long time TKL user and member here on the forums, it's always great to see someone new come along with something to offer back so thanks again. That's not to take away from others who may not have the knowledge or skills to provide patches, etc, but we can all do our little bit!

PS John; I forgot to answer your question re formatting FAQ. AFAIK there isn't one. Personally I just use the WYSIWYG buttons and they work pretty nice. If you want to use plain text then you can but I can't help at all with markup, perhaps someone else can?

John's picture

Thank you Jedmeister for

Thank you Jedmeister for formatting my post.

I know now what the Problem was yesterday. The WYSIWG Editor wasn't there just a plain textbox, and so i wondered what the formatting options were.

And i forgot to mention something else:

This Patch is tested under: Hardy-Core and Lucid-RC-Core


Great job John!

I didn't know about icinga, looks like a nice alternative to nagios. I'll check it out when I have some time. 

Liraz Siri's picture

Awesome! Icinga will be a part of the TKL 11.0 release

What a great way to join the community John. Icinga rocks! Thanks for bringing it to our attention and going the extra mile to make a TKLPatch for it.

As a Nagios user I felt the sting of its shortcomings myself. We've been meaning to add a nice monitoring appliance to the library but Nagios was a poor fit. Without a decent UI, the learning curve was steep enough such that a TurnKey Nagios appliance didn't really make sense. But Icinga changes all that. It's beautiful! I'm glad they forked it over. It's a great testament to the strength and potential of open source.

Bottom line, this is a great project and we'll do our part to support it by getting it into the upcoming TKL release.

Icinga in TKL

Hi, this is great news for Icinga. If there is anything we can do to make the integration easier for you, just let us know. Thanks, Karo

John's picture

Great News

These are really great news. I'm looking forward to it.
 

John
 


Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)