Install Icinga2 v2.4.2 (Network Monitoring Tool) on Ubuntu, Debian & Mint

Icinga is a scalable and extensible monitoring system which checks the availability of your resources from multiple location, notifies users of outages and provides extensive BI data. Icinga2 designed to mointor large omplex environments. Read about Icingaweb2 Installation, install Icinga2 on RPM based system such as CentOS, RHEL, Fedora & openSUSE & Adding Icinga2 Remote Linux Host. Icinga2 supports all major distributions such as (CentOS, RHEL, Fedora, Ubuntu, Debian, gentoo, ArchLinux, suse & openSUSE and MySQL, and PostgreSQL databases currently. The latest version of Icinga2 2.4.1 released on November 26, 2015. Alternatively you can install other network monitoring tools such as Zabbix, Monitorix, Cacti, Munin & Nagios.

Main features of Icinga2

  • Monitoring of network services (SMTP, POP3, HTTP, NNTP, ping, etc.)
  • Monitoring of host resources (CPU load, disk usage, etc.)
  • Monitoring of server components (switches, routers, temperature and humidity sensors, etc.)
  • Simple plug-in design that allows users to easily develop their own service checks
  • Parallelized service checks
  • Ability to define network host hierarchy using “parent” hosts, allowing detection of and distinction between hosts that are down and those that are unreachable
  • Ability to define event handlers to be run during service or host events for proactive problem resolution
  • Notification of contact persons when service or host problems occur and get resolved (via email, pager, or user-defined method)
  • Escalation of alerts to other users or communication channels
  • Two optional user interfaces (Icinga Classic UI and Icinga Web) for visualization of host and service status, network maps, reports, logs, etc.
  • Icinga Reporting module based on open source Jasper Reports for both Icinga Classic and Icinga Web user interfaces
  • Capacity utilization reporting
  • Performance graphing via add-ons such as PNP4Nagios, NagiosGrapher and InGraph
  • Icinga 2 & Icinga Web 2 release notes

1) Adding Icinga2 Repository

First we need to add the Icinga2 repository in our system to install icinga2 latest version and future upgrade too. Make sure you should install LAMP stack before proceeding Icinga2 installation.

# Adding Repository to Ubuntu/Mint #
$ sudo add-apt-repository ppa:formorer/icinga
$ sudo apt-get update

# Adding Repository to Debian #
$ wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
$ sudo echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list
$ sudo apt-get update

2) Install Icinga2

Just fire the below commands to install, enable & start the icinga2.

# To Install Icinga2 #
$ sudo apt-get install icinga2

# For SysVinit systems #
$ sudo chkconfig icinga2 on
$ sudo service icinga2 start

# For Systemd systems #
$ sudo systemctl enable icinga2.service
$ sudo systemctl start icinga2.service

3) Enabled Features checking

By default Icinga2 install and enable below there features. You can check this by running below command.

  • checker for executing checks
  • notification for sending notifications
  • mainlog for writing the icinga2.log file
# Enabled Features during Installation #
# icinga2 feature list
Disabled features: api command compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslog
Enabled features: checker mainlog notification

4) Install Icinga2 plugin

Icinga2 will collect the service information based on the monitoring plugins. So, we need to install nagios plugin using below command.

# To Install Nagios Plugin #
$ sudo apt-get install nagios-plugins

5) Install IDO modules for MySQL

We are going to Install IDO modules for MySQL which will use for Icinga2 Web interface and other web interfaces. The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of exporting all configuration and status information into a database.

# To Install IDO Module #
$ sudo apt-get install icinga2-ido-mysql

6) Setting up the MySQL database

Setting up the MySQL database for Icinga2.

# Setting up the MySQL database Icinga2 #
$ sudo mysql -u root -p
MariaDB [(none)]> CREATE DATABASE icinga;

MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';

MariaDB [(none)]> exit
Bye

# Importing the Icinga 2 IDO schema into database #
$ sudo mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql

# Enabling the IDO MySQL module #
$ sudo icinga2 feature enable ido-mysql
warning/cli: Feature 'ido-mysql' already enabled.
Make sure to restart Icinga 2 for these changes to take effect.

# For SysVinit systems #
$ sudo service restart icinga2

# For Systemd systems #
$ sudo systemctl restart icinga2.service

7) Setup Firewall Rules

If you installed iptables you have to allow the httpd and its port to work outside the world.

# All Distro #
$ sudo iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$ sudo service iptables save

8) Setting Up External Command Pipe

Web interfaces and other Icinga addons are able to send commands to Icinga 2 through the external command pipe.

# enable the External Command Pipe #
$ sudo icinga2 feature enable command

# For SysVinit systems #
$ sudo service restart icinga2

# For Systemd systems #
$ sudo systemctl restart icinga2.service

# Adding the webserver's user to the group icingacmd #
$ sudo usermod -a -G icingacmd apache

Ref : Icinga2 installation
That’s it as of now, Stay tune with 2daygeek for Latest Linux Geeks….)

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

  • Simon,
    We have notyet published till now and i have added into my todo list.

  • Simon Bishop

    Do you have an article about Observium? I recently read about it and I like to try it. I saw that you have tutorials for Zabbix, Icinga etc…
    Edit:
    I found it. A little research goes a long way they say. 🙂
    If anyone needs it I found it on the Rosehosting blog.

Close
Please support the site
By clicking any of these buttons you help our site to get better