Install iCinga on Centos

Description

iCinga is a scalable and extensible open source monitoring system which checks the availability of your resources, notifies users of outages and provides extensive BI (Business Intelligence) data. This document will show you how to download, install and configure iCinga for your own subdomain “icinga.example.org

Software Installation

  1. Add a DNS A-Record or CNAME pointing your preferred subdomain to your server. We’re using “icinga” in this document for our subdomain.
  2. Add the EPEL Yum software repository.
  3. C6: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    C7: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

  4. Add the IUS Yum software repository.
  5. C6: rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm
    C7: rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm

  6. Add the iCinga Yum software repository.
  7. cd /etc/yum.repos.d && wget http://packages.icinga.org/epel/ICINGA-release.repo

    nano /etc/yum.repos.d/icinga-stable.repo

  8. Install the PHP 5.6 modules and dependencies for Apache httpd from IUS and EPEL.
  9. Install iCinga2 and dependencies.
  10. Setup Installation Token

    icingacli setup token create
    The newly generated setup token is: 21347c1bc476c37a

    icingacli setup token show
    The current setup token is: 21347c1bc476c37a

    Webserver setup

  11. Go get a free SSL certificate for added security.
  12. If it doesn’t already exist, create a default config and edit it like the one below to correspond with your preferred subdomain.
  13. Create a default config at: /etc/httpd/conf.d/icingaweb2.conf
    icingacli setup config webserver apache

    Or copy and modify the following config and put it in: /etc/httpd/conf.d/icingaweb2.conf

  14. Edit /etc/php.ini and find the line “;date.timezone =” and change it to your timezone.
  15. nano /etc/php.ini
    ;date.timezone = America/Vancouver

  16. Enable, disable and view status of iCinga features.
  17. icinga2 feature list

    Disabled features: api debuglog gelf graphite icingastatus livestatus opentsdb perfdata syslog
    Enabled features: checker command compatlog ido-mysql mainlog notification statusdata

    icinga2 feature enable perfdata
    Enabling feature perfdata. Make sure to restart Icinga 2 for these changes to take effect.

  18. Restart the webserver and iCinga and visit the expected subdomain.
  19. C6: service httpd restart
    C7: systemctl restart httpd.service

    C6: service icinga2 restart
    C7: systemctl restart icinga2.service

    http://icinga.example.org

    MySQL / MariaDB Database Setup

  20. Setup MySQL / MariaDB databases and database users.
  21. Make sure to remember your database name, database username and database password, the host will be “localhost“.

    mysql -p

  22. Load IDO and Web schemas for MySQL / MariaDB.
  23. mysql -u warren -ppassword icinga_2 < /usr/share/icinga2-ido-mysql/schema/mysql.sql
    mysql -u warren -ppassword icinga_web < /usr/share/doc/icingaweb2/schema/mysql.schema.sql

  24. Edit IDO config database user credentials.
  25. If the installer is not able to write this info, you can insert it manually rather than granting the webserver privileges to write in this one file one time,

    nano /etc/icinga2/features-enabled/ido-mysql.conf

  26. Restart the icinga2 service.
  27. C6: service icinga2 restart
    C7: systemctl restart icinga2.service

Maintenance & Cleanup

When editing the configs, make sure to clean the config cache afterwards by deleting all *.php files in /var/cache/icinga-web/ or invoking
/usr/share/icinga-web/bin/clearcache.sh

Further Reading

Screenshots

Last Modified: 29 Dec, 2015 at 12:56:28