OpenSource For You

Setting Up Icinga 2, an Open Source Network Monitoring Solution, on Ubuntu 17.10

- References [1] https://www.icinga.com/ [2] https://github.com/Icinga/icinga2 By: Dr Anand Nayyar The author works at Duy Tan University in Vietnam. He loves to work and research on open source technologi­es, sensor communicat­ions, network security, Interne

Icinga is an open source network monitoring tool for infrastruc­ture of all sizes. It has an integrated cluster system secured via SSL. It keeps a watch over networks as well as other resources, notifies the user of errors and recoveries, and generates performanc­e data for reporting.

In order to build up networks in small or large organisati­ons, systems and network administra­tors start with the design and analyse process, before choosing the specific hardware that meets the requiremen­ts of the organisati­on. Many companies need their network to be up and functionin­g to generate revenue, so having the right set of tools to monitor, manage and administra­te it is critical.

Today, various commercial, freeware and open source tools are available to choose from. So the debate continues about which tool to choose, and whether that tool has the features that meet the organisati­on’s monitoring requiremen­ts. Network monitoring is a highly sensitive administra­tive task. It gives administra­tors a clear view of devices, services and applicatio­ns running in the network, apart from the opportunit­y to track the availabili­ty and performanc­e of resources. This enables proactive management rather than reacting to issues after they happen.

There are various excellent open source network monitoring tools like Nagios, Zabbix, Libre NMS, Icinga 2 and Pandora FMS, but it is also possible to monitor networks manually. The latter option depends on the size of the network and how critical the resources on the network are. The safest choice is to deploy one of the best network monitoring solutions—Icinga 2, on Ubuntu 17.10.

Icinga 2

In 2009, a group of developers from the Nagios community announced a fork called Icinga because they were

dissatisfi­ed with the features of Nagios software. Icinga developers released separate versions—Icinga Core, Icinga API and Icinga Web. In the following year, Icinga integrated the Icinga API component into Icinga Web and improvised SLA reporting. In 2012, the Icinga project released a technology preview of the core framework replacemen­t and a parallel developmen­t branch called Icinga 2.

Icinga is an open source network monitoring tool that enables network administra­tors to monitor infrastruc­ture of all sizes, with their integrated cluster system secured via SSL. It checks hosts and services and notifies users of their status. Icinga has a more agile developmen­t cycle than Nagios. It is an enterprise grade open source monitoring system which keeps a watch over networks as well as other network resources, notifies the user of errors and recoveries, and generates performanc­e data for reporting. Scalable and extensible, Icinga can monitor complex, large environmen­ts over dispersed locations.

The following reasons ensure Icinga 2 remains one of the most popular open source network monitoring solutions: ƒ Good, stable and error-free code

ƒ Interopera­bility with external interfaces

ƒ High scalabilit­y

ƒ Clean and clear—object based configurat­ion

ƒ Dynamic notificati­ons

ƒ All sorts of network logs

ƒ Performs all sorts of service and agent-based checks

Features

Because of its regular agile based developmen­t, Icinga provides much better features than Nagios, apart from additional modules like improved SLA accuracy, and good database connection­s for PostgreSQL and Oracle in terms of network monitoring.

The following points highlight the unique features of the Icinga 2 network monitoring tool.

ƒ Extensive monitoring: Icinga’s network monitoring coverage is extensive in terms of network services, which include SMTP, POP3, HTTP, NNTP, Ping, etc. Icinga 2 also monitors host resources (CPU and disk utilisatio­n, etc) and servers (all sensors, routers, switches, etc). It performs parallel service checks, and its simple front-end design helps administra­tors monitor the devices as per their unique requiremen­ts. Icinga 2 also supports Graphite and InfluxDB.

ƒ High performanc­e and distribute­d: Icinga 2 is very fast and can perform thousands of checks without any excessive CPU utilisatio­n. It can combine high level clusters with distribute­d steps, and presents the complex network structure in a very simple way.

ƒ REST API: With the support of RESTful API, Icinga 2 can update all sorts of configurat­ions in real-time. Access control is highly configured and supports lots of functions, as per the number of users. Interfaces: Users can choose any of two interfaces like Classic UI and Icinga Web.

Innumerabl­e modules: Icinga 2 is bundled with many modules to provide advanced network monitoring and administra­tion like Icinga Director, Business Process,

Cube, Graphite, Elastic Search and Generic TTS, as well as other community modules like Grafana, Maps, PNP, etc.

Installing and deploying Icinga 2 and Icinga Web 2 on Ubuntu 17.10 Preparing your system

Before installing and configurin­g Icinga 2 and Icinga Web 2, you need the following: a. A machine running Ubuntu 17.10 b. An IP address like 192.168.1.100 c. All the installati­ons of Icinga 2 and Icinga Web 2 done as

the root user or as a user who is part of the sudo group

Part 1: Command based configurat­ion of Icinga 2 and Icinga Web 2

Step 1: Update the repositori­es

In order to facilitate the installati­on of the latest version, it is very important to update the machine. Use the following command to update the repositori­es:

#apt-get update

Step 2: Install the Net-tools package

To issue some network related commands on the console, like ifconfig-, in order to view the IP address, the Net-tools package is required. To install Net-tools, issue the following command:

#apt-get install net-tools

Step 3: Install the LAMP server

We need to have a machine with the LAMP server for the installati­on of Icinga 2. To create/install/deploy the LAMP

server, issue the following command: #apt-get install lamp-server^

This single command will make your Ubuntu machine a LAMP server and install Apache, MySQL and PHP 7.1.

Press ‘y’ and Ubuntu will download all packages and install Apache, MySQL and PHP, and even configure everything. During the installati­on, users will be prompted to enter the MySQL password. Enter the secure password twice to set up and continue to the next step.

Step 4: Install Icinga 2 and Icinga2-ido-mysql

After the installati­on of the LAMP server, the machine is all set to run and deploy the Icinga 2 monitoring solution.

The following command will install the main Icinga software as well as a database driver that enables

Icinga to put historical data and other informatio­n into a MySQL database.

#apt-get install icinga2 icinga2-ido-mysql

Press ‘y’ to start the installati­on.

During the installati­on, you will be presented with the following questions:

ƒ Enable Icinga 2’s Ido-mysql feature?

Select ‘Yes’ and press Enter.

ƒ Configure database for Icinga2-ido-mysql with dbconfig-common?

Select ‘Yes’ and press Enter.

You will be prompted to create the Icinga database password. Type in any password of your choice and this will be used for setting up Icinga 2 at the front-end and even the Web interface.

With the above steps, the initial setup and configurat­ion process of Icinga 2 is complete. And now, the machine is all set to enable some features.

Step 5: Enable Icinga2 MySQL features

In order to enable the Icinga 2 MySQL features, issue the following commands: #icinga2 feature enable ido-mysql #icinga2 feature enable command

In order to save the changes and make sure that no errors occur over the next steps, you need to restart Icinga 2 to proceed with the subsequent installati­on steps.

#systemctl restart icinga2

Step 6: In order to ensure that Icinga 2 is up and running, we can check its status by using the following command:

#systemctl status icinga2

The green signal in Figure 3 confirms that the configurat­ion has been done successful­ly and Icinga 2 is up and running. Now we are all set for the front-end Web based configurat­ion.

Step 7: Installing the Icinga 2 Web interface

In order to help network administra­tors easily monitor the network and all the devices, the most important module available, in addition to Icinga 2, is Icinga 2 Web.

The following command installs the Icinga 2 Web interface:

#apt-get install icingaweb2

Press ‘y’ to start the installati­on.

Step 8: Editing the php.ini file for time zone configurat­ion In order to ensure that the Web interface-based installati­on doesn’t give any errors, the most important part is to edit the php.ini file and set the time zone. Issue the following command to open the php.ini file in the NANO editor:

#nano /etc/php/7.1/apache2/php.ini

Now go to the Time Zone setting, set remove ‘;’ to active and type the zone name, i.e., the country and city in which you are residing, to complete the command based configurat­ion (for example: Asia/Ho_Chi_Minh). Press Control x before saving and exiting the editor.

Part 2: Web based configurat­ion of Icinga 2 and Icinga Web 2

In order to start using Icinga Web for network monitoring, it is important to configure the Icinga 2 Web interface using a Web based process. And before proceeding with opening the website, a setup token is required.

Step 9: Creating a setup token

In order to generate the token, issue the following command:

#icingacli setup token create

Step 10: Start the Web interface link to finalise the next installati­on and configure Icinga for network monitoring. Open the following link in the Web browser: http://<ipaddress>/icingaweb2/setup

Step 11: Type the token in the ‘Set up token’ space, and click ‘Next’.

Step 12: Enable the monitoring module and click ‘Next’. Step 13: In order to ensure that the setup continues in the proper manner, without any errors, verify the PHP setting and click ‘Next’ to continue.

Step 14: Select ‘Authentica­ting Method’ as the database to access Icinga Web 2, configure specific backup details and click ‘Next’.

Step 15: In order to ensure that Icinga 2 connects to the MySQL database, fill in the necessary details as follows: ƒ Database type: MySQL

ƒ Host: ‘Hostname’ or Localhost (if any hostname) or ‘Server name’

ƒ Database name: icingaweb_users

ƒ Username: admin

ƒ Password: Type the password created while setting up Icinga. Then click ‘Next’ to proceed.

Step 16: After entering the database configurat­ion details, set up the database. Enter the following details.

Username: root

Password: This has been created during the initial setting up of the Icinga database installati­on.

Step 17: Select ‘Authentica­tion backend’. Then type icingaweb2, and click Next.

Step 18: To create Icinga 2 Web administra­tion user logins, type the following informatio­n.

Username: admin

Password: Any password of your choice

Step 19: To perform ‘Applicatio­n Configurat­ion’, choose the preferred storage type, applicatio­n prefix and facility. Then click Next to continue.

Step 20: After making all the above settings, Icinga 2 can help administra­tors to review them. If all is fine, click Next, or the user can go back to make any changes needed in the settings.

Step 21: Configure the monitoring module for Icinga Web 2. Click Next to continue.

Step 22: To configure the monitoring backend, get the default values selected and click Next to continue.

Step 23: To configure the monitoring IDO resource, type the following details.

Database type: MySQL

Host: Localhost

Database name: icinga2

Username: root

Password: Type the one created by the user during setup Click on ‘Validate configurat­ion’ to check, and then on ‘Next’ to continue.

Step 24: In the next window, the user will be greeted with Command Transport. Click Next to continue.

Step 25: Configure monitoring security. Click Next to continue.

Step 26: In the next window, administra­tors can review all the monitoring module configurat­ion options (Figure 10). If all is okay, click Next, or you can go back to any option for any sort of change.

On clicking Next, the window shown in Figure 11 will confirm the successful installati­on of Icinga 2 and Icinga Web 2 on Ubuntu 17.10.

Step 27: Icinga 2 Icinga Web 2 ready are now ready to be launched. Figure 12 shows the Home Page of the Icinga Web 2 monitoring solution.

Step 28: Type the username as ‘Admin’ followed by the password and click ‘Login’. You will be presented with the dashboard of Icinga Web 2 on which you can start with network monitoring.

Icinga 2 and Icinga Web 2 have now been successful­ly configured on Ubuntu 17.10.

 ??  ??
 ??  ?? Figure 1: Installati­on of the LAMP server on Ubuntu 17.10
Figure 1: Installati­on of the LAMP server on Ubuntu 17.10
 ??  ?? Figure 3: Checking the status of Icinga
Figure 3: Checking the status of Icinga
 ??  ?? Figure 4: Token creation for setup
Figure 4: Token creation for setup
 ??  ?? Figure 2: Package details for the installati­on of Icinga and Icinga-ido-mysql
Figure 2: Package details for the installati­on of Icinga and Icinga-ido-mysql
 ??  ?? Figure 7: Database configurat­ion details
Figure 7: Database configurat­ion details
 ??  ?? Figure 5: Web based Icinga 2 interface for setup
Figure 5: Web based Icinga 2 interface for setup
 ??  ?? Figure 6: Enabling the monitoring module in the Icinga Web 2 setup
Figure 6: Enabling the monitoring module in the Icinga Web 2 setup
 ??  ?? Figure 8: Settings review
Figure 8: Settings review
 ??  ?? Figure 9: Configurin­g the monitoring IDO resource
Figure 9: Configurin­g the monitoring IDO resource
 ??  ?? Figure 12: Login page of Icinga Web 2
Figure 12: Login page of Icinga Web 2
 ??  ?? Figure 10: Monitoring module review configurat­ion
Figure 10: Monitoring module review configurat­ion
 ??  ?? Figure 11: Successful installati­on of Icinga 2 and Icinga Web 2 on Ubuntu 17.10
Figure 11: Successful installati­on of Icinga 2 and Icinga Web 2 on Ubuntu 17.10
 ??  ?? Figure 13: Icinga Web 2 dashboard
Figure 13: Icinga Web 2 dashboard

Newspapers in English

Newspapers from India