Set­ting Up Icinga 2, an Open Source Net­work Mon­i­tor­ing So­lu­tion, on Ubuntu 17.10

OpenSource For You - - Contents - Ref­er­ences [1] https://www.icinga.com/ [2] https://github.com/Icinga/icinga2 By: Dr Anand Nay­yar The au­thor works at Duy Tan Univer­sity in Viet­nam. He loves to work and re­search on open source tech­nolo­gies, sen­sor com­mu­ni­ca­tions, net­work se­cu­rity, In­terne

Icinga is an open source net­work mon­i­tor­ing tool for in­fras­truc­ture of all sizes. It has an in­te­grated clus­ter sys­tem se­cured via SSL. It keeps a watch over net­works as well as other re­sources, no­ti­fies the user of er­rors and recoveries, and gen­er­ates per­for­mance data for re­port­ing.

In or­der to build up net­works in small or large or­gan­i­sa­tions, sys­tems and net­work ad­min­is­tra­tors start with the de­sign and an­a­lyse process, be­fore choos­ing the spe­cific hard­ware that meets the re­quire­ments of the or­gan­i­sa­tion. Many com­pa­nies need their net­work to be up and func­tion­ing to gen­er­ate rev­enue, so hav­ing the right set of tools to mon­i­tor, man­age and ad­min­is­trate it is crit­i­cal.

To­day, var­i­ous com­mer­cial, free­ware and open source tools are avail­able to choose from. So the de­bate con­tin­ues about which tool to choose, and whether that tool has the fea­tures that meet the or­gan­i­sa­tion’s mon­i­tor­ing re­quire­ments. Net­work mon­i­tor­ing is a highly sen­si­tive ad­min­is­tra­tive task. It gives ad­min­is­tra­tors a clear view of de­vices, ser­vices and ap­pli­ca­tions run­ning in the net­work, apart from the op­por­tu­nity to track the avail­abil­ity and per­for­mance of re­sources. This en­ables proac­tive man­age­ment rather than re­act­ing to is­sues af­ter they hap­pen.

There are var­i­ous ex­cel­lent open source net­work mon­i­tor­ing tools like Na­gios, Zab­bix, Li­bre NMS, Icinga 2 and Pan­dora FMS, but it is also pos­si­ble to mon­i­tor net­works man­u­ally. The lat­ter op­tion de­pends on the size of the net­work and how crit­i­cal the re­sources on the net­work are. The safest choice is to de­ploy one of the best net­work mon­i­tor­ing so­lu­tions—Icinga 2, on Ubuntu 17.10.

Icinga 2

In 2009, a group of de­vel­op­ers from the Na­gios com­mu­nity an­nounced a fork called Icinga be­cause they were

dis­sat­is­fied with the fea­tures of Na­gios soft­ware. Icinga de­vel­op­ers re­leased sep­a­rate ver­sions—Icinga Core, Icinga API and Icinga Web. In the fol­low­ing year, Icinga in­te­grated the Icinga API com­po­nent into Icinga Web and im­pro­vised SLA re­port­ing. In 2012, the Icinga project re­leased a tech­nol­ogy pre­view of the core frame­work re­place­ment and a par­al­lel de­vel­op­ment branch called Icinga 2.

Icinga is an open source net­work mon­i­tor­ing tool that en­ables net­work ad­min­is­tra­tors to mon­i­tor in­fras­truc­ture of all sizes, with their in­te­grated clus­ter sys­tem se­cured via SSL. It checks hosts and ser­vices and no­ti­fies users of their sta­tus. Icinga has a more ag­ile de­vel­op­ment cy­cle than Na­gios. It is an en­ter­prise grade open source mon­i­tor­ing sys­tem which keeps a watch over net­works as well as other net­work re­sources, no­ti­fies the user of er­rors and recoveries, and gen­er­ates per­for­mance data for re­port­ing. Scal­able and ex­ten­si­ble, Icinga can mon­i­tor com­plex, large en­vi­ron­ments over dis­persed lo­ca­tions.

The fol­low­ing rea­sons en­sure Icinga 2 re­mains one of the most pop­u­lar open source net­work mon­i­tor­ing so­lu­tions: ƒ Good, sta­ble and er­ror-free code

ƒ In­ter­op­er­abil­ity with ex­ter­nal in­ter­faces

ƒ High scal­a­bil­ity

ƒ Clean and clear—ob­ject based con­fig­u­ra­tion

ƒ Dy­namic no­ti­fi­ca­tions

ƒ All sorts of net­work logs

ƒ Per­forms all sorts of ser­vice and agent-based checks

Fea­tures

Be­cause of its reg­u­lar ag­ile based de­vel­op­ment, Icinga pro­vides much bet­ter fea­tures than Na­gios, apart from ad­di­tional mod­ules like im­proved SLA ac­cu­racy, and good data­base con­nec­tions for PostgreSQL and Or­a­cle in terms of net­work mon­i­tor­ing.

The fol­low­ing points high­light the unique fea­tures of the Icinga 2 net­work mon­i­tor­ing tool.

ƒ Ex­ten­sive mon­i­tor­ing: Icinga’s net­work mon­i­tor­ing cov­er­age is ex­ten­sive in terms of net­work ser­vices, which in­clude SMTP, POP3, HTTP, NNTP, Ping, etc. Icinga 2 also mon­i­tors host re­sources (CPU and disk util­i­sa­tion, etc) and servers (all sen­sors, routers, switches, etc). It per­forms par­al­lel ser­vice checks, and its sim­ple front-end de­sign helps ad­min­is­tra­tors mon­i­tor the de­vices as per their unique re­quire­ments. Icinga 2 also sup­ports Graphite and In­fluxDB.

ƒ High per­for­mance and dis­trib­uted: Icinga 2 is very fast and can per­form thou­sands of checks with­out any ex­ces­sive CPU util­i­sa­tion. It can com­bine high level clus­ters with dis­trib­uted steps, and presents the com­plex net­work struc­ture in a very sim­ple way.

ƒ REST API: With the sup­port of REST­ful API, Icinga 2 can up­date all sorts of con­fig­u­ra­tions in real-time. Ac­cess con­trol is highly con­fig­ured and sup­ports lots of func­tions, as per the num­ber of users. In­ter­faces: Users can choose any of two in­ter­faces like Clas­sic UI and Icinga Web.

In­nu­mer­able mod­ules: Icinga 2 is bun­dled with many mod­ules to pro­vide ad­vanced net­work mon­i­tor­ing and ad­min­is­tra­tion like Icinga Direc­tor, Busi­ness Process,

Cube, Graphite, Elas­tic Search and Generic TTS, as well as other com­mu­nity mod­ules like Grafana, Maps, PNP, etc.

In­stalling and de­ploy­ing Icinga 2 and Icinga Web 2 on Ubuntu 17.10 Pre­par­ing your sys­tem

Be­fore in­stalling and con­fig­ur­ing Icinga 2 and Icinga Web 2, you need the fol­low­ing: a. A ma­chine run­ning Ubuntu 17.10 b. An IP ad­dress like 192.168.1.100 c. All the in­stal­la­tions 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: Com­mand based con­fig­u­ra­tion of Icinga 2 and Icinga Web 2

Step 1: Up­date the repos­i­to­ries

In or­der to fa­cil­i­tate the in­stal­la­tion of the lat­est ver­sion, it is very im­por­tant to up­date the ma­chine. Use the fol­low­ing com­mand to up­date the repos­i­to­ries:

#apt-get up­date

Step 2: In­stall the Net-tools pack­age

To is­sue some net­work re­lated com­mands on the con­sole, like if­con­fig-, in or­der to view the IP ad­dress, the Net-tools pack­age is re­quired. To in­stall Net-tools, is­sue the fol­low­ing com­mand:

#apt-get in­stall net-tools

Step 3: In­stall the LAMP server

We need to have a ma­chine with the LAMP server for the in­stal­la­tion of Icinga 2. To cre­ate/in­stall/de­ploy the LAMP

server, is­sue the fol­low­ing com­mand: #apt-get in­stall lamp-server^

This sin­gle com­mand will make your Ubuntu ma­chine a LAMP server and in­stall Apache, MySQL and PHP 7.1.

Press ‘y’ and Ubuntu will down­load all pack­ages and in­stall Apache, MySQL and PHP, and even con­fig­ure ev­ery­thing. Dur­ing the in­stal­la­tion, users will be prompted to en­ter the MySQL pass­word. En­ter the se­cure pass­word twice to set up and con­tinue to the next step.

Step 4: In­stall Icinga 2 and Icinga2-ido-mysql

Af­ter the in­stal­la­tion of the LAMP server, the ma­chine is all set to run and de­ploy the Icinga 2 mon­i­tor­ing so­lu­tion.

The fol­low­ing com­mand will in­stall the main Icinga soft­ware as well as a data­base driver that en­ables

Icinga to put his­tor­i­cal data and other in­for­ma­tion into a MySQL data­base.

#apt-get in­stall icinga2 icinga2-ido-mysql

Press ‘y’ to start the in­stal­la­tion.

Dur­ing the in­stal­la­tion, you will be pre­sented with the fol­low­ing ques­tions:

ƒ En­able Icinga 2’s Ido-mysql fea­ture?

Se­lect ‘Yes’ and press En­ter.

ƒ Con­fig­ure data­base for Icinga2-ido-mysql with db­con­fig-com­mon?

Se­lect ‘Yes’ and press En­ter.

You will be prompted to cre­ate the Icinga data­base pass­word. Type in any pass­word of your choice and this will be used for set­ting up Icinga 2 at the front-end and even the Web in­ter­face.

With the above steps, the ini­tial setup and con­fig­u­ra­tion process of Icinga 2 is com­plete. And now, the ma­chine is all set to en­able some fea­tures.

Step 5: En­able Icinga2 MySQL fea­tures

In or­der to en­able the Icinga 2 MySQL fea­tures, is­sue the fol­low­ing com­mands: #icinga2 fea­ture en­able ido-mysql #icinga2 fea­ture en­able com­mand

In or­der to save the changes and make sure that no er­rors oc­cur over the next steps, you need to restart Icinga 2 to pro­ceed with the sub­se­quent in­stal­la­tion steps.

#sys­tem­ctl restart icinga2

Step 6: In or­der to en­sure that Icinga 2 is up and run­ning, we can check its sta­tus by us­ing the fol­low­ing com­mand:

#sys­tem­ctl sta­tus icinga2

The green sig­nal in Fig­ure 3 con­firms that the con­fig­u­ra­tion has been done suc­cess­fully and Icinga 2 is up and run­ning. Now we are all set for the front-end Web based con­fig­u­ra­tion.

Step 7: In­stalling the Icinga 2 Web in­ter­face

In or­der to help net­work ad­min­is­tra­tors eas­ily mon­i­tor the net­work and all the de­vices, the most im­por­tant mod­ule avail­able, in ad­di­tion to Icinga 2, is Icinga 2 Web.

The fol­low­ing com­mand in­stalls the Icinga 2 Web in­ter­face:

#apt-get in­stall icin­gaweb2

Press ‘y’ to start the in­stal­la­tion.

Step 8: Edit­ing the php.ini file for time zone con­fig­u­ra­tion In or­der to en­sure that the Web in­ter­face-based in­stal­la­tion doesn’t give any er­rors, the most im­por­tant part is to edit the php.ini file and set the time zone. Is­sue the fol­low­ing com­mand to open the php.ini file in the NANO editor:

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

Now go to the Time Zone set­ting, set re­move ‘;’ to ac­tive and type the zone name, i.e., the coun­try and city in which you are re­sid­ing, to com­plete the com­mand based con­fig­u­ra­tion (for ex­am­ple: Asia/Ho_Chi_Minh). Press Con­trol x be­fore sav­ing and ex­it­ing the editor.

Part 2: Web based con­fig­u­ra­tion of Icinga 2 and Icinga Web 2

In or­der to start us­ing Icinga Web for net­work mon­i­tor­ing, it is im­por­tant to con­fig­ure the Icinga 2 Web in­ter­face us­ing a Web based process. And be­fore pro­ceed­ing with open­ing the web­site, a setup to­ken is re­quired.

Step 9: Cre­at­ing a setup to­ken

In or­der to gen­er­ate the to­ken, is­sue the fol­low­ing com­mand:

#icin­ga­cli setup to­ken cre­ate

Step 10: Start the Web in­ter­face link to fi­nalise the next in­stal­la­tion and con­fig­ure Icinga for net­work mon­i­tor­ing. Open the fol­low­ing link in the Web browser: http://<ipad­dress>/icin­gaweb2/setup

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

Step 12: En­able the mon­i­tor­ing mod­ule and click ‘Next’. Step 13: In or­der to en­sure that the setup con­tin­ues in the proper man­ner, with­out any er­rors, ver­ify the PHP set­ting and click ‘Next’ to con­tinue.

Step 14: Se­lect ‘Authen­ti­cat­ing Method’ as the data­base to ac­cess Icinga Web 2, con­fig­ure spe­cific backup de­tails and click ‘Next’.

Step 15: In or­der to en­sure that Icinga 2 con­nects to the MySQL data­base, fill in the nec­es­sary de­tails as fol­lows: ƒ Data­base type: MySQL

ƒ Host: ‘Host­name’ or Lo­cal­host (if any host­name) or ‘Server name’

ƒ Data­base name: icin­gawe­b_users

ƒ User­name: ad­min

ƒ Pass­word: Type the pass­word cre­ated while set­ting up Icinga. Then click ‘Next’ to pro­ceed.

Step 16: Af­ter en­ter­ing the data­base con­fig­u­ra­tion de­tails, set up the data­base. En­ter the fol­low­ing de­tails.

User­name: root

Pass­word: This has been cre­ated dur­ing the ini­tial set­ting up of the Icinga data­base in­stal­la­tion.

Step 17: Se­lect ‘Au­then­ti­ca­tion back­end’. Then type icin­gaweb2, and click Next.

Step 18: To cre­ate Icinga 2 Web ad­min­is­tra­tion user lo­gins, type the fol­low­ing in­for­ma­tion.

User­name: ad­min

Pass­word: Any pass­word of your choice

Step 19: To per­form ‘Ap­pli­ca­tion Con­fig­u­ra­tion’, choose the pre­ferred stor­age type, ap­pli­ca­tion pre­fix and fa­cil­ity. Then click Next to con­tinue.

Step 20: Af­ter mak­ing all the above set­tings, Icinga 2 can help ad­min­is­tra­tors to re­view them. If all is fine, click Next, or the user can go back to make any changes needed in the set­tings.

Step 21: Con­fig­ure the mon­i­tor­ing mod­ule for Icinga Web 2. Click Next to con­tinue.

Step 22: To con­fig­ure the mon­i­tor­ing back­end, get the de­fault val­ues se­lected and click Next to con­tinue.

Step 23: To con­fig­ure the mon­i­tor­ing IDO re­source, type the fol­low­ing de­tails.

Data­base type: MySQL

Host: Lo­cal­host

Data­base name: icinga2

User­name: root

Pass­word: Type the one cre­ated by the user dur­ing setup Click on ‘Val­i­date con­fig­u­ra­tion’ to check, and then on ‘Next’ to con­tinue.

Step 24: In the next win­dow, the user will be greeted with Com­mand Trans­port. Click Next to con­tinue.

Step 25: Con­fig­ure mon­i­tor­ing se­cu­rity. Click Next to con­tinue.

Step 26: In the next win­dow, ad­min­is­tra­tors can re­view all the mon­i­tor­ing mod­ule con­fig­u­ra­tion op­tions (Fig­ure 10). If all is okay, click Next, or you can go back to any op­tion for any sort of change.

On click­ing Next, the win­dow shown in Fig­ure 11 will con­firm the suc­cess­ful in­stal­la­tion 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. Fig­ure 12 shows the Home Page of the Icinga Web 2 mon­i­tor­ing so­lu­tion.

Step 28: Type the user­name as ‘Ad­min’ fol­lowed by the pass­word and click ‘Lo­gin’. You will be pre­sented with the dash­board of Icinga Web 2 on which you can start with net­work mon­i­tor­ing.

Icinga 2 and Icinga Web 2 have now been suc­cess­fully con­fig­ured on Ubuntu 17.10.

Fig­ure 1: In­stal­la­tion of the LAMP server on Ubuntu 17.10

Fig­ure 3: Check­ing the sta­tus of Icinga

Fig­ure 4: To­ken cre­ation for setup

Fig­ure 2: Pack­age de­tails for the in­stal­la­tion of Icinga and Icinga-ido-mysql

Fig­ure 7: Data­base con­fig­u­ra­tion de­tails

Fig­ure 5: Web based Icinga 2 in­ter­face for setup

Fig­ure 6: En­abling the mon­i­tor­ing mod­ule in the Icinga Web 2 setup

Fig­ure 8: Set­tings re­view

Fig­ure 9: Con­fig­ur­ing the mon­i­tor­ing IDO re­source

Fig­ure 12: Lo­gin page of Icinga Web 2

Fig­ure 10: Mon­i­tor­ing mod­ule re­view con­fig­u­ra­tion

Fig­ure 11: Suc­cess­ful in­stal­la­tion of Icinga 2 and Icinga Web 2 on Ubuntu 17.10

Fig­ure 13: Icinga Web 2 dash­board

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.