Icinga Setup on CentOS 6

From Nikoforge Wiki
Jump to: navigation, search

Contents

Introduction

Icinga is an open source network and computer system monitoring application. It was originally created as a fork of the Nagios system monitoring application. Icinga has an Ajax driven, Web 2.0 inspired frontend. Read more on Wikipedia and on the Icinga homepage.

This document describes how to install Icinga including PNP4Nagios for performance data graphes on a CentOS server. The commands in the boxes can be copied and pasted directly into a Linux terminal.

Basic Server installation

CentOS Server (32-bit)

Set up the 32-bit server as described here: Basic Installation of a CentOS 6 Server

Note-icon.gif Note:
CentOS 32-bit was chosen as the VMWare Perl Toolkit 64-bit installer failed on CentOS x64_86.

Install required Packages

 yum -y install httpd mod_ssl gd gd-devel mysql-server php-mysql php-xmlrpc

Install the Nikoforge Repository

rpm -ivH http://repo.nikoforge.org/redhat/el6/nikoforge-release-latest

Install Icinga

Icinga and PNP4Nagios Packages

yum -y --disablerepo=rpmforge install icinga icinga-doc icinga-gui \
    icinga-web pnp4nagios icinga-idoutils-libdbi-mysql nrpe-plugin

Turn on collecting performance data

sed -i 's/^ *process_performance_data *=.*/process_performance_data=1/' /etc/icinga/icinga.cfg

Set the Timezone

Proper time setting is required to make the scheduled check commands work.

Set the variable TIMEZONE to your timezone, e.g. "Europe/Berlin"

export TIMEZONE="Europe/Berlin"
sed -i "s|^[ ;]*date.timezone *=.*|date.timezone='$TIMEZONE'|" /etc/php.ini

See list of supported timezones

Setup MySQL

chkconfig mysqld on
service mysqld start

Set MySQL root Password

Follow instructions on the page Set a new MySQL root password

Create Database

echo "CREATE DATABASE icinga; \
GRANT USAGE ON *.* TO 'icinga'@'localhost' \
  IDENTIFIED BY 'icinga' \
  WITH MAX_QUERIES_PER_HOUR 0 \
  MAX_CONNECTIONS_PER_HOUR 0 \
  MAX_UPDATES_PER_HOUR 0; \
GRANT SELECT , INSERT , UPDATE , DELETE, DROP, CREATE VIEW \
  ON icinga.* TO 'icinga'@'localhost'; \
FLUSH PRIVILEGES;" \
| mysql 

Import Schema

cat /usr/share/doc/icinga-idoutils-libdbi-mysql-*/db/mysql/mysql.sql | mysql icinga

Start all Services

chkconfig npcd on
chkconfig ido2db on
chkconfig icinga on
chkconfig httpd on
service npcd start
service ido2db start
service icinga start
service httpd start

Test classic Web GUI

Set a SHA encrypted administrator password for Basic Authentication

htpasswd -s /etc/icinga/passwd icingaadmin

Open the URL https://ICINGA_SERVER_IP/icinga and login with user icingaadmin and the just set password.

Icinga-classical-web-screenshot.png

Traditional in look and feel, this is Icinga’s interface for those who like the familiar single window format as in Nagios, combined with cool enhancements.

Icinga New Web

Dynamic and user-friendly, this is Icinga’s Agavi based, Ajax driven, Web 2.0 inspired frontend. Read more...

Create Database

echo "CREATE DATABASE icinga_web; \
 GRANT USAGE ON *.* TO 'icinga_web'@'localhost' \
   IDENTIFIED BY 'icinga_web' \
   WITH MAX_QUERIES_PER_HOUR 0 \
   MAX_CONNECTIONS_PER_HOUR 0 \
   MAX_UPDATES_PER_HOUR 0; \
 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX \
   ON icinga_web.* TO 'icinga_web'@'localhost'; \
 FLUSH PRIVILEGES ;" \
 | mysql

Import Schema

cat /usr/share/icinga-web/etc/schema/mysql.sql | mysql icinga_web 

Test New Web GUI

Open the URL https://ICINGA_SERVER_IP/icinga-web and login with user root and password password.

Icinga-new-web-screenshot.png Icinga-new-web-screenshot-2.png

Do not forget to set a new password in the Admin menu. See Icinga Web Manual

Configure Monitoring

Remove the sample config.

sed --in-place=.BAK 's/^\(cfg_file.*\)/#\1/' /etc/icinga/icinga.cfg

then place your own config files into /etc/icinga/conf.d. When done check the config with

icinga -v /etc/icinga/icinga.cfg

and restart the service

service icinga restart

Additional Information

Related Pages

Package List

For reference purposes a list of all installed RPM packages of a working installation can be found here.

Update

yum --disablerepo=* --enablerepo=nikoforge update
yum update 

User comments

Please leave your comments and suggestions on the discussion page.

Leave your comments here

brizolas said ...

<comment date="2012-04-11T14:42:29Z" name="brizolas"> nice tutorial :) thank you </comment>

Twister said ...

<comment date="2012-04-23T13:17:28Z" name="Twister"> Great tut!

Thanks

--Twister </comment>

pnp4nagios - yum states that there is now package for this?


You're right. The epel repo provides version 0.6.16. The nikoforge repo has version 0.6.18 which has also some mods for Icinga.

Mweinber 19:51, 10 October 2012 (CEST)


Personal tools
Namespaces
Variants
Actions
Navigation
Category cloud