bosnadev

№ 16 · 2015-03-19 · 2 min · server

Installing Icinga2 (fork of Nagios) on Debian 7 (Wheezy)

Installing Icinga 2 and the Nagios plugins on Debian 7 from the debmon repository, with MySQL through IDO, and Icinga Web with a fix for a package bug.

written before the past year · entry 16 of 31 · 10 in the past year

This article is out of date
Written for Debian 7 (Wheezy) and the first Icinga 2 packages in 2015.

Contents

  • 1 Preface
  • 2 Prerequisits
  • 3 Icinga and nagios plugins
  • 4 Icinga Web
    • 4.1 Hans Kohl

Preface

Icinga is a fork of Nagios monitoring system. There are lots of changes and upgrades compared to Nagios, especially in version 2. The main visible difference is UI which is built on ext js. Other significant differences are in hosts and services definitions (it will be covered in part 2).

For this tutorial we’re going to use Digital Ocean smallest droplet with installed Debian 7.8.

Prerequisits

We’ll use debmon repository

At the end of file “/etc/apt/source.list” add the following entry:

/etc/apt/source.list2 lines
#ICINGAdeb http://debmon.org/debmon debmon-wheezy main

Repository key:

terminal1 line
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -

Now run:

terminal1 line
apt-get update && apt-get -y upgrade

If there was a kernel upgrade (like in my case), reboot the server before proceeding to the next step.

Icinga and nagios plugins

terminal1 line
apt-get install icinga2 nagios-plugins -y

Starting the service

terminal4 lines
root@icinga-mon:~# /etc/init.d/icinga2 start[ ok ] checking Icinga2 configuration.[ ok ] Starting icinga2 monitoring daemon: icinga2.root@icinga-mon:~#

We also want icinga integration with the database.

Install MySQL and IDO-MySQL

terminal2 lines
apt-get install mysql-serveraptitude install icinga2-ido-mysql -y

And enable manually ido-mysql:

terminal3 lines
root@icinga-mon:/etc/icinga2# icinga2 feature enable ido-mysqlEnabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect.root@icinga-mon:/etc/icinga2# /etc/init.d/icinga2 restart

Icinga Web

terminal1 line
apt-get install icinga-web -y

Choose dbconfig-common for db setup and it will prompt you for web interface password.
After the setup icinga-web will bi available on: http://SERVER/icinga-web/

username:root
password: (set during the installation)

There seems to be a bug in icinga-web package from debmon.

Screenshot from 2015-03-19 14:07:33

After checking with chrome inspect tool, the url with this issue was:
http://SERVER/icinga-web/modules/cronks/reloadStatus/json?_dc=1426770390818

PDO Connection Error: SQLSTATE[28000] [1045] Access denied for user 'icinga'@'localhost' (using password: YES)

The issue is in config file that is (for some reason) used for db connection:

/usr/share/icinga-web/app/config/databases.xml

Line 39:

<ae:parameter name="dsn">mysql://icinga_web:[email protected]:3306/icinga_web</ae:parameter>

Change with data from:

/etc/icinga-web/conf.d/database-web.xml

Line 90:

<ae:parameter name="dsn">mysql://icinga:[email protected]:3306/icinga</ae:parameter>

Change with data from:

/etc/icinga2/features-available/ido-mysql.conf

Ingraph

terminal1 line
apt-get install ingraph -y

In the next part of this tutorial we’ll go through configuration for new hosts and services.

Related

SSH Authentication With Keys Instead PasswordsserverApache2 mod_fcgid: HTTP request length exceeds MaxRequestLenserverHow To Redirect www To non-www And Vice Versa with Nginxserver