Super detailed CentOS 7 x/ubuntu 15.04 installation Icinga Web 2

Source: Internet
Author: User
Tags icinga opentsdb

Icinga is an open source network monitoring Application This provides us with Icinga Web 1 and Icinga Web 2 interfaces to Fully manage and monitor the hosts and services through its dashboard. Icinga Web 2 is the successor of Icinga Web which are lightweight, fast and flexible to embed into other projects that supp Orts multiple authentication methods like Active Directory, LDAP or database and multiple monitoring back ends. So, this a major advance in the creation of the hosts and services actions, instead of defining them via Icinga ' s configuratio n files and every user is now enabled to create them with the Web interface and even share them to others.

We can customize and configure the Icinga Web 2 using many modules for it views, filters and dashboards. Timestamps and status updates can be refreshed automatically every second, rolling along smoothly saving your eyes the str Ain of flickering displays.

In this article we'll be using the CentOS 7 for the complete installation and configuration of Icinga Web 2. If you want the use of Ubuntu as your base Operating system then you can also refer to our previous article OFICINGA2 on Ubunt U 15.04.

Installing Prerequisites

Icinga Web 2 installation depends upon a number of following packages that must being installed on your system before the INS Tallation of Icinga Web 2 on CentOS 7 or Ubuntu 15.

Let's follow the below steps to complete the prerequisites by installing required packages and other settings.

1) System Update

Login to your system with root or sudo user privileges and run the following command to update your system.

For CentOS:

# Yum Update

For Ubuntu:

# Apt-get Update

2) Installing Icinga 2

To install Icinga 2 we'll use the official package repositories that can is downloaded from Thisicinga Web Page.

To setup EPRL repositories for Icinga installation run the following commands.

For CentOS:
To import the archive key and to setup the Surrent stable builds of Icinga, run below command.

# RPM--import Http://packages.icinga.org/icinga.key

# wget Http://packages.icinga.org/epel/ICINGA-release.repo-O/etc/yum.repos.d/icinga-release.repo

# yum Makecache

Now run the Icinga 2 installation command as shown below.

# yum Install Icinga2

The following number of packages including the dependencies would be installed as shown. To proceed run type the ' Y ' key to continue.

===========================================================================================
Package Arch Version Repository Size
================================================================================= ==========
Installing:
icinga2 x86_64 2.3.10-1.el7.centos icinga-stable-release 9.1 k
Installing for Dependencies:
boost-program-options x86_64 1.53.0-23.el7 base 155 k
Boost-regex x86_64 1.53.0-23.el7 base 294 k
Boost-system x86_64 1.53.0-23.el7 base x86_64 k
Boost-thread 1.53.0-23.el7 icinga2-bin base-K
0-1.el7.centos icinga-stable-release 2.2 M
Icinga2-common x86_64 2.3.10-1.el7.centos icinga-stable-release k

Transaction Summary
===================================================================================== ======
Install 1 package (+6 Dependent packages)

Total download size:2.8 m
installed size:15 m
are this OK [y/d/n]: y

For Ubuntu
Run the below commands to add the Icinga repository to your package management configuration using PPA.

# add-apt-repository Ppa:formorer/icinga

# Apt-get Update

# Apt-get Install ICINGA2

The installation process is installing the Icinga 2 including some of its required dependencies.

The following extra packages'll be installed:
Icinga2-bin Icinga2-common icinga2-doc libboost-program-options1.55.0 libboost-regex1.55.0 libboost-system1.55.0
libboost-thread1.55.0 libyajl2 Nagios-plugins-basic Nagios-plugins-common
Suggested Packages:
NAGIOS3 Icinga
The following NEW packages'll be installed
ICINGA2 icinga2-bin Icinga2-common icinga2-doc libboost-program-options1.55.0 libboost-regex1.55.0 libboost-system1.55.0
libboost-thread1.55.0 libyajl2 Nagios-plugins-basic Nagios-plugins-common
0 to upgrade, one to newly install, 0 to remove and upgrade.
Need to get 3,201 KB of archives.
After this operation, 18.4 MB of additional disk space would be used.
Want to continue? [y/n] Y

3) Starting Icinga 2

Upon successful installation of Icinga 2, now start IT services and enable them to start at each reboot.

For CentOS 7/ubuntu 15
Run the following commands to Enable, Start and check the status of Icinga 2 service on Centos 7 and Ubuntu 15.

# Systemctl Enable ICINGA2

# Systemctl Start ICINGA2

# SYSTEMCTL Status Icinga2

4) MySQL Database Setup

We'll be using the MySQL data base, that'll be a used for Icinga Web 2 interface. So, let's run the below commands to install MySQL MariaDB.

For CentOS 7

# yum Install Mariadb-server mariadb

After installation completes, start the MARIADB services and configure its root password using the below command.

#systemctl Enable MARIADB
#systemctl Start mariadb

#mysql_secure_installation

For Ubuntu 15

To install the MySQL database run the below command and configure the root password during the installation process.

#apt-get Install Mysql-server mysql-client

#service MySQL Start

Create New Database

Now login to the MYSQL/MARIADB and create the new database with a new user with its specific privileges on the database us ing the below commands.

MariaDB [(None)]> CREATE DATABASE icinga2;
Query OK, 1 row Affected (0.00 sec)

MariaDB [(None)]> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE on icinga2.* to ' icinga2 ' @ ' lo Calhost ' identified by ' icinga123 ';
Query OK, 0 rows Affected (0.00 sec)

MariaDB [(None)]>exit

5) Installing MySQL IDO Module

For CentOS:

Run the below command to install IDO MySQL module for ICINGA2.

#yum Install Icinga2-ido-mysql

Now import the Icinga 2 IDO schema using the following command.

# mysql-u Root-p Icinga2 </usr/share/icinga2-ido-mysql/schema/mysql.sql

A new configuration file would be created after installation of Icinga IDO Module which is located in/etc/icinga2/features -available/ido-mysql.conf. So, open this file using any editor and update the database credentials in this file.

Library "Db_ido_mysql"
Object Idomysqlconnection "Ido-mysql" {
user = "Icinga"
Password = "Icinga"
host = "localhost"
Database = "Icinga"
}

Then enable module and check the list it should now listed under the enabled module by using the following command in cent OS 7.

[Email protected] ~]# ICINGA2 feature enable Ido-mysql
Warning/cli:feature ' Ido-mysql ' already enabled.

[Email protected] ~]# ICINGA2 Feature List
Disabled features:api command Compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslo G
Enabled features:checker ido-mysql mainlog Notification

For Ubuntu:

In Ubuntu during the installation process of IDO MySQL Module, you'll be asked Configure the Icinga2-ido-mysql whether Y ou want to enable it or not.

# Apt-get Install Icinga2-ido-mysql

So, you'll choose the "Yes" option and press OK to proceed then in the next steps you had to configure its configuratio n file by providing the MySQL root credentials, that would configure the following new configuration files.

Creating config file/etc/dbconfig-common/config with new version
Setting up Icinga2-ido-mysql (2.3.10-1~PPA1~VIVID1) ...
dbconfig-common:writing Config to/etc/dbconfig-common/icinga2-ido-mysql.conf

Creating config file/etc/dbconfig-common/icinga2-ido-mysql.conf with new version

Creating config file/etc/icinga2/features-available/ido-mysql.conf with new version
Granting access to database icinga2idomysql for [email protected]: success.
verifying access for [email protected]: success.
Creating Database Icinga2idomysql:success.
Verifying database Icinga2idomysql exists:success.
Populating database via SQL ... done.
Dbconfig-common:flushing Administrative Password

Like the same, run the below command to Enale IDO MySQL Icinga Module.

[Email protected]:~# icinga2 feature Enable Ido-mysql
Enabling feature Ido-mysql. Make sure-restart Icinga 2 for these changes-take effect.
[Email protected]:~# service ICINGA2 Restart
[Email protected]:~# icinga2 Feature List
Disabled features:api command Compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslo G
Enabled features:checker ido-mysql mainlog Notification

You check and change the Dtaabase configuration setting if required by using the below file.

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

6) Web Server Setup

After completing the database installation and configuration setup, now we move towards Apache Web server installation BEF Ore starting the Icinga Web 2.

Let's run the below commands to setup your Web server installation.

For CentOS
In CentOS, you can use the following commands to install Apache server and start its services as shown.

# yum Install httpd
# Systemctl Enable httpd
# Systemctl Start httpd

For Ubuntu
For Ubuntu you'll use the following commands for the Apache Web Server installation.

# Apt-get Install Apache2
# service Apache2 Start

Firewall Setting
Use the following commands-to-allow Apache services in your firewall.

# Firewall-cmd--add-service=http
# Firewall-cmd--permanent--add-service=http
# Firewall-cmd--reload

# iptables-a input-p tcp-m tcp--dport 80-j ACCEPT
# Service Iptables Save

7) External Command Pipe Setup:

To enable the External Command Pipe we'll be using the below, so that the Web interfaces and other Icinga addons is ABL E to send commands to Icinga 2 through the external command pipe.

# ICINGA2 feature enable command
Enabling feature command. Make sure-restart Icinga 2 for these changes-take effect.
# Service ICINGA2 Restart
# ICINGA2 Feature List
Disabled features:api compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslog
Enabled features:checker command IDO-MYSQL mainlog notification

Icinga Web 2 Installation

Now start the installation of Icinga Web 2

For CentOS 7:

# RPM--import Http://packages.icinga.org/icinga.key

# Curl-o/etc/yum.repos.d/icinga-release.repo Http://packages.icinga.org/epel/ICINGA-release.repo

# yum Makecache

# yum Install icingaweb2 ICINGACLI

For Ubuntu

# Wget-o-Http://packages.icinga.org/icinga.key | Apt-key Add-

# add-apt-repository ' Deb Http://packages.icinga.org/ubuntu icinga-trusty main '

# Apt-get Update

# Apt-get Install ICINGAWEB2

Icinga Web 2 Setup:

When the installion are complete, Open your Web browser and give the URL using your hostname or the IP address with the add Ition to '/icingaweb2/setup '. You'll find the below Icinga Web 2 Setup Wizard as shown.

As shown above this asks for a setup token, so do sure you run the server this installation of Icinga Web 2 runs on. Go back to your terminal and run the below commands.

# ICINGACLI Setup Token create

The newly generated setup token IS:8CFE15C9B0D7EF2A

I You forget the newly created token and you can check by using the below command.

# ICINGACLI Setup Token show
The current setup token IS:8CFE15C9B0D7EF2A

Copy the newly created token and place it in the Web Setup to move to next setup.

Then you'll be directed to the pre installed modules Setup So, simply press the next key.

Now, the below is the main sections to configure all the requirements before moving to the next step.

We have to fulfill all these requirements, so first of all we'll configure the time zone and then install the required p HP modules using the below commands.

# Vim/etc/php5/apache2/php.ini
[Date]
Date.timezone = Europe/london
: wq!

# apt-get Install Php5-json php5-gd php5-imagick php5-pgsql php5-intl

After installation restart the Apache Web services and press the "Refresh key to re check" the requirements and you'll fou nd no missing module as shown below.

Next option is to choose the authentication type, where as we'll be using the here the database as a authentication method.

Now we need to configure the database resource where to store users and user groups. Before moving to next option press the Database validation key.

Upon providing the credentials you might get the below a message, but there was nothing to worry if your was unable to valida Te your database just choose the Skip Validation option and click on the Next button.

If you chooses to skip validation, then you'll be asked to recreate your administrator account, choose the user name and Give it a password.

Then choose the appropriate options to adjust all application and logging related configuration options to fit your needs as shown.

At this point you ' ve configured Icinga Web 2 successfully. You can review the changes supposed to being made before setting it up. Make sure this everything is correct (feel free to navigate back to make any corrections!) so this you can start using Ici Nga Web 2 Right after it had successfully been set up.

Welcome to the configuration of the monitoring module for Icinga WEB 2!

This is the core module for Icinga Web 2. It offers various status and reporting views with powerful filter capabilities so allow you to keep track of the most IM Portant events in your monitoring environment.

Then choose the Monitoring backend configuration so how it retrieve the information.

Choose the database name, user and its password so created after installing the Icinga IDO MySQL Module and then Val Idate the database.

Choose The default options for Command transport and monitoring Security and which it you ' ve configured the monitoring Modu Le successfully. Now take review of the changes and click on the Finish button to ' finish ' to make sure everything have been setup well.

Icinga Web 2 Dashboard

Conclusion

We have successfully installed and configured Icinga Web 2 and ready to monitoring our hosts and services through its inte Ractive Web interface. Hopefully understand all the steps, so feel free to share your your experience if you face any kind of difficulty w Hile preparing Your own Icinga Web 2 setup on CentOS or Ubutu.

Super detailed CentOS 7 x/ubuntu 15.04 installation Icinga Web 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.