How to Install Icinga 2 and Icinga Web 2 on Ubuntu and Linux Mint - Cloud Network

Networking | Support | Tricks | Troubleshoot | Tips

Buymecoffe

Buy Me A Coffee

Thursday, October 24, 2019

How to Install Icinga 2 and Icinga Web 2 on Ubuntu and Linux Mint

Install Icinga and Icinga Web Monitoring Tool on Ubuntu



For Download Icinga Repositories : - https://icinga.com/download/

Login to root user:
$ su

Enter the command to install dbconfig-common package:
# apt-get install dbconfig-common


Add Icinga Repository
If ‘add-apt-repository’ command doesn’t work, install the following package:
# apt-get install python-software-properties

Add Icinga repository with command on Ubuntu:
# add-apt-repository ppa:formorer/icinga

Update sources list:
# apt-get update

Now install Icinga and its dependencies with following command:
# apt-get install icinga icinga-idoutils mysql-server libdbd-mysql mysql-client

Configure idoutils

Create a file /etc/icinga/modules/idoutils.cfg
sudo nano /etc/icinga/modules/idoutils.cfg
Add the following lines:

define module{
        module_name     idomod
        module_type     neb
        path            /usr/lib/icinga/idomod.so
        args            config_file=/etc/icinga/idomod.cfg
        }


Create symbolic links with following command:
# ln -s /usr/lib/icinga/idomod.so /usr/sbin/

Configure ido2db
Open the file /etc/default/icinga:
# nano /etc/default/icinga

Find the line:
# start ido2db daemon (no/yes)
IDO2DB=no

Change the value ‘no’ to ‘yes’:
# start ido2db daemon (no/yes)
IDO2DB=yes

Now start ido2db and restart icinga services:
# /etc/init.d/ido2db start
# /etc/init.d/icinga restart

Monitor Remote Hosts with Icinga

Install nrpe and nagios plugins in your remote system.

To install nrpe & nagios-plugins, enter the command:
$ sudo apt-get install openssl nagios-nrpe-server nagios-plugins nagios-plugins-basic nagios-plugins-standard

Now open /etc/nagios/nrpe.cfg file:
$ sudo nano /etc/nagios/nrpe.cfg

Find the line:
# server_address=127.0.0.1

Uncomment and add your Icinga server IP address as shown below:
server_address=127.0.0.1 192.168.1.201

Here 192.168.1.201 is my Icinga server IP address. Restart nrpe to save changes:
$ sudo /etc/init.d/nagios-nrpe-server restart

Add Remote Hosts to Icinga Server
Now go back to Icinga server side and do the following steps. Open the file /etc/icinga/objects/localhost_icinga.cfg:
# nano /etc/icinga/objects/localhost_icinga.cfg



Add the following lines next to the localhost template:
define host{
        use                     generic-host            ; Name of host template$
        host_name               ubuntu    
        alias                   ubuntu    
        address                 192.168.1.100
        }

Here 192.168.1.100 is my local ubuntu 18.04 desktop.

Add Services for Remote Hosts in Icinga Server

To add a service scroll down further in icinga configuration file. You will find a service templates as shown below. Just add your remote hostname to be monitored separated with comma(,).

define service{
        use                             generic-service         ; Name of servi$
        host_name                       localhost
        service_description             Disk Space
        check_command                   check_all_disks!20%!10%
        }

Now restart icinga services:
# /etc/init.d/icinga restart