{"id":261,"date":"2015-09-07T16:07:46","date_gmt":"2015-09-07T16:07:46","guid":{"rendered":"http:\/\/onlinelab.info\/?p=261"},"modified":"2015-09-07T16:07:46","modified_gmt":"2015-09-07T16:07:46","slug":"setup-icinga-monitoring-tool-on-centos-7-rhel-7","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/09\/07\/setup-icinga-monitoring-tool-on-centos-7-rhel-7\/","title":{"rendered":"Setup Icinga Monitoring Tool on CentOS 7 \/ RHEL 7"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7423\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/08\/Icinga-Logo.png\" alt=\"Icinga Logo\" width=\"228\" height=\"107\" title=\"\"><\/p>\n<p>Icinga is a fork of famous Ngaios monitoring tool, it is very compatible with Nagios and can be integrated with Nagios plugins. Icinga is very similar to Nagios, so you wont find any difficult in moving to Icinga. Icinga is one step ahead on multiple factors, the import factor is advanced reporting using we based jasper reports,\u00a0 the most improved web interface and its comes as virtual appliance.<\/p>\n<p>This post will help you to setup <a href=\"http:\/\/www.itzgeek.com\/tag\/icinga\" target=\"_blank\" rel=\"nofollow noopener\">Icinga<\/a> on <a href=\"http:\/\/www.itzgeek.com\/tag\/centos-7\" target=\"_blank\" rel=\"nofollow noopener\">CentOS 7 \/ RHEL 7.<\/a><\/p>\n<h3><strong>Prerequisites:<\/strong><\/h3>\n<p>Before we go ahead, lets install the required packages for Icinga.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># yum -y install wget httpd mod_ssl gd gd-devel mariadb-server php-mysql php-xmlrpc gcc mariadb libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Disable SELinux.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">sed -i 's\/SELINUX=enforcing\/SELINUX=disabled\/g' \/etc\/selinux\/config<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Reboot once done.<\/p>\n<p>Create <strong>icinga<\/strong> user and <strong>icinga-cmd<\/strong> group (allowing the external commands to be executed through the web interface) , <strong>add\u00a0 icinga and apache user to the part of icinga-cmd group<\/strong>.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># useradd icinga\n# groupadd icinga-cmd\n# usermod -a -G icinga-cmd icinga\n# usermod -a -G icinga-cmd apache<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Download latest Icinga source tarball.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># cd \/tmp\/\n# wget http:\/\/downloads.sourceforge.net\/project\/icinga\/icinga\/1.10.1\/icinga-1.10.1.tar.gz\n# tar -zxvf \/tmp\/icinga-1.10.1.tar.gz\n# cd \/tmp\/icinga-1.10.1<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Compile and Install Icinga:<\/strong><\/h3>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># .\/configure --with-command-group=icinga-cmd --enable-idoutils\n# make all\n# make install\n# make install-init\n# make install-config\n# make install-commandmode\n# make install-webconf\n# make install-idoutils<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Configure Icinga:<\/strong><\/h3>\n<p>Sample configuration files have now been installed in the <strong>\/usr\/local\/icinga\/etc\/<\/strong> directory. These sample files should work fine for getting started with Icinga. You\u2019ll need to make just one change before you proceed. Edit the <strong>\/usr\/local\/icinga\/etc\/objects\/contacts.cfg<\/strong> config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you\u2019d like to use for receiving alerts.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># vi \/usr\/local\/icinga\/etc\/objects\/contacts.cfg<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Change the Email address field to receive the notification.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">email\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 icinga@localhost<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>to<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">email\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 icinga@itzgeek.com<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Move sample idoutils configuration files to Icinga base directory.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># cd \/usr\/local\/icinga\/etc\/\n# mv idomod.cfg-sample idomod.cfg\n# mv ido2db.cfg-sample ido2db.cfg\n# cd modules\/\n# mv idoutils.cfg-sample idoutils.cfg<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Create database for idoutils:<\/strong><\/h3>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># systemctl start mariadb.service\n# mysql -u root -p\nMariaDB [(none)]&gt; CREATE DATABASE icinga;\nMariaDB [(none)]&gt; GRANT USAGE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;\nMariaDB [(none)]&gt; FLUSH PRIVILEGES;\nMariaDB [(none)]&gt; quit<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Import Database.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># mysql -u root -p icinga &lt; \/tmp\/icinga-1.10.1\/module\/idoutils\/db\/mysql\/mysql.sql<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Configure Web Interface:<\/strong><\/h3>\n<p>Create a icingaadmin account for logging into the Icinga web interface. Remember the password that you assign to this user \u2013 you\u2019ll need it later.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># htpasswd -c \/usr\/local\/icinga\/etc\/htpasswd.users icingaadmin<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Restart Apache to make the new settings take effect.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">systemctl restart httpd.service<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Download and Install Nagios Plugins:<\/strong><\/h3>\n<p>Download Nagios Plugins to \/tmp directory.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># cd \/tmp\n# wget http:\/\/nagios-plugins.org\/download\/nagios-plugins-2.0.3.tar.gz\n# tar -zxvf \/tmp\/nagios-plugins-2.0.3.tar.gz\n# cd \/tmp\/nagios-plugins-2.0.3\/<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Compile and install the plugins.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># .\/configure --prefix=\/usr\/local\/icinga --with-cgiurl=\/icinga\/cgi-bin --with-nagios-user=icinga --with-nagios-group=icinga\n# make\n# make install<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Starting Icinga:<\/strong><\/h3>\n<p>Verify the sample Icinga configuration files.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># \/usr\/local\/icinga\/bin\/icinga -v \/usr\/local\/icinga\/etc\/icinga.cfg<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>If there are no errors, start Nagios and Idoutils.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># \/etc\/init.d\/icinga start\n# \/etc\/init.d\/ido2db start<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Start Icinga and Idoutils on system startup.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># chkconfig ido2db on\n# chkconfig icinga on\n# systemctl enable httpd.service\n# systemctl enable mariadb.service<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>Access Web Interface:<\/strong><\/h3>\n<p>Now access Icinga web interface using the following URL. You\u2019ll be prompted for the username (icingaadmin) and password you specified earlier.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">http:\/\/ip-address\/icinga\/<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<figure id=\"attachment_7417\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7417\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/08\/CentOS-7-Icinga-Dashboard.jpg\" alt=\"CentOS 7 - Icinga Dashboard\" width=\"640\" height=\"454\" title=\"\"><figcaption class=\"wp-caption-text\">CentOS 7 \u2013 Icinga Dashboard<\/figcaption><\/figure>\n<p>Click on service details to check the status.<\/p>\n<figure id=\"attachment_7418\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7418\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/08\/CentOS-7-Icinga-localhost-Service-details.jpg\" alt=\"CentOS 7 - Icinga localhost Service details\" width=\"640\" height=\"452\" title=\"\"><figcaption class=\"wp-caption-text\">CentOS 7 \u2013 Icinga localhost Service details<\/figcaption><\/figure>\n<h3><strong>Troubleshooting:<\/strong><\/h3>\n<p>If you get any unknown waring for ping check.<\/p>\n<figure id=\"attachment_7428\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7428\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/08\/CentOS-7-Icinga-Ping-Unknown-Warning1.jpg\" alt=\"CentOS 7 - Icinga Ping Unknown Warning\" width=\"623\" height=\"20\" title=\"\"><figcaption class=\"wp-caption-text\">CentOS 7 \u2013 Icinga Ping Unknown Warning<\/figcaption><\/figure>\n<p>please execute the following command in the terminal to resolve the issue.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># chmod u+s \/bin\/ping<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>If you get any waring for httpd check.<\/p>\n<figure id=\"attachment_7420\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7420\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/08\/CentOS-7-Icinga-Httpd-Warning.jpg\" alt=\"CentOS 7 - Icinga Httpd Warning\" width=\"640\" height=\"29\" title=\"\"><figcaption class=\"wp-caption-text\">CentOS 7 \u2013 Icinga Httpd Warning<\/figcaption><\/figure>\n<p>Place index.html on document root.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># echo \"Home Page\" &gt; \/var\/www\/html\/index.html<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>That\u2019s All!. You have successfully installed Icinga on CentOS 7 \/ RHEL 7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Icinga is a fork of famous Ngaios monitoring tool, it is very compatible with Nagios and can be integrated with Nagios plugins. Icinga is very similar to Nagios, so you wont find any difficult in&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-261","post","type-post","status-publish","format-standard","hentry","category-monitoring"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=261"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/261\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}