Install icinga with IDOUtils on CentOS/RHEL 5 or 6

Overview

Icinga is a fork of nagios. It is free just as Nagios is and fully compatible with Nagios configuration files, that is if you so wish you can move from Nagios to Icinga without much hassle. Just install icinga and move all the configuration files from nagios to Icinga, Icinga will recognize them and start working. Now why would you make such transition, there are couple of factors that make Icinga better than Nagios, the most important being advanced reporting that come along Icinga other is the improved web interface. There are some other for more head over to Icinga’s official website here.

Install icinga with IDOUtils on CentOS/RHEL 5 or 6

Install the necessary packages


# yum install libdbi-devel net-snmp* gd gd-devel gcc mysql-server mysql httpd libdbi-dbd-mysql httpd-devel mysql-devel libdbi libdbi-drivers

Create Icinga user account and provide appropriate permissions.


# /usr/sbin/useradd icinga -s /sbin/nologin
# passwd icinga
# /usr/sbin/groupadd icinga-cmd
# /usr/sbin/usermod -a -G icinga-cmd icinga

Icinga uses Nagios Plugins so download Icinga and Nagios Plugins


# cd /opt
# wget http://sourceforge.net/projects/icinga/files/icinga/1.8.1/icinga-1.8.1.tar.gz
# wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz

Compile and Install Icinga with IDOUtils


# tar xvzf icinga-1.8.1.tar.gz
# cd icinga-1.8.1
# ./configure --with-command-group=icinga-cmd --enable-idoutils
# make all
# make install
# make install-config
# make install-commandmode
# make install-idoutils
# make install-init

Now lets customize our configuration. Open contacts.cfg file and change the email from “icinga@localhost” to yours in this file, just as I am putting mine. Also move idoutils sample configuration files to icinga base directory.

# vi /usr/local/icinga/etc/objects/contacts.cfg

icinga@localhost to keenan@linuxdrops.com

# cd /usr/local/icinga/etc/
# mv idomod.cfg-sample idomod.cfg
# mv ido2db.cfg-sample ido2db.cfg
# cd modules
# mv idoutils.cfg-sample idoutils.cfg

Create Database for IDOUtils


# service mysqld start
# mysql -u root -p
mysql> CREATE DATABASE icinga;
mysql> GRANT USAGE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit
# cd /opt/icinga-1.8.1/module/idoutils/db/mysql
# mysql -u root -p icinga < mysql.sql

There are two interfaces available, one is simple classic nagios like interface, other is an advanced version. Here we are implementing the Classic Web Interface.


# cd /opt/icinga-1.8.1
# make cgis
# make install-cgis
# make install-html
# make install-webconf

Create an account named icingaadmin for logging into the Icinga classic web interface


# htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin
# service httpd restart

Compile and Install the Nagios Plugins

# cd /opt
# tar xvzf nagios-plugins-1.4.16.tar.gz
# cd nagios-plugins-1.4.16
# ./configure --prefix=/usr/local/icinga --with-cgiurl=/icinga/cgi-bin --with-nagios-user=icinga --with-nagios-group=icinga
# make
# make install

Start IDOUtils and Icinga, also make sure these services start on server reboot


# chkconfig --add ido2db
# service ido2db start
# chkconfig --add icinga
# service icinga start

Point your browser to “http://[IP-Address]/icinga/”.

Move the hosts and services configuration files from Nagios to Icinga or add your hosts and services. The configuration files are under


# cd /usr/local/icinga/etc

Verify your configuration


# /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg

Reload Icinga


# service icinga reload

Refresh the browser and find all the hosts and services added to Icinga.
icinga base1 300x176 Install icinga with IDOUtils on CentOS/RHEL 5 or 6