1. Install ICINGA2 core package via Yum
a) package repositories
# RPM--import Http://packages.icinga.org/icinga.key
# Curl-o/etc/yum.repos.d/icinga-release.repohttp://packages.icinga.org/fedora/icinga-release.repo
# yum Makecache
b) installing Icinga 2
# yum Install Icinga2
# Systemctl Enable ICINGA2
# Systemctl Start ICINGA2
c) Enabled Features during installation
# ICINGA2 Feature List
Display content divided into disabled and eabled 2 sections
DISABLEDFEATURES:API command compatlog debuglog graphite icingastatus ido-mysqlido-pgsql livestatus Notification PerfData Statusdata syslog
Enabled Features:checker mainlognotification
2. Installing Nagios-plugins-all
A) install Epel
EPEL, extra Packages for Enterprise Linux, is a set of high-quality, additional software packages that are provided for business-class Linux, including but not limited to Red Hat enterpriselinux (RHEL),
# yum-y Install Epel-release
# yum Clean all && yum Makecache
# yum Install Nagios-plugins-all–y
Check the /usr/lib/nagios/plugins or/usr/lib64/nagios/plugins directory for the appropriate plugin file
3. Running ICINGA2
$ SYSTEMCTL Status ICINGA2
$ systemctl Enable ICINGA2
$ systemctl Restart ICINGA2
COMMAND |
DESCRIPTION |
Start |
thestart Action starts the Icinga 2 daemon. |
Stop |
thestop Action stops the Icinga 2 daemon. |
Restart |
therestart Action is a shortcut for running stop The action followed bystart. |
reload |
the reload   action sends the hup   signal to Icinga 2 which causes it to restart. Unlike the restart   ACTION  reload   does not wait until Icinga 2 have restarted. |
Checkconfig |
thecheckconfig Action checks if /etc/icinga2/icinga2.conf The configuration file contains any errors. |
Status |
thestatus Action checks if Icinga 2 is running. |
4. Setting Up Icinga Web 2
a) configuring DB idomysql
The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of exporting allconfiguration and status Informatio n into a database. The IDO database is usedby a number of projects including Icinga Web 2, Icinga Reporting or Icinga Web 1 . x
I. installingmysql database Server
# yum Install Mariadb-server mariadb
# Systemctl Enable MARIADB
# Systemctl Start mariadb
# mysql_secure_installation
II. installingthe IDO modules for MySQL
# yum Install Icinga2-ido-mysql
iii. settingup the MySQL database
# mysql-u Root-p
mysql> CREATE DATABASE Icinga;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, Executeon icinga.* to ' icinga ' @ ' localhost ' identified by ' Icinga ';
Aftercreating the database you can import the Icinga 2 IDO schema using thefollowing command:
# mysql-u Root-p Icinga </usr/share/icinga2-ido-mysql/schema/mysql.sql
The package provides a new configuration Filethat was installed /etc/icinga2/features-available/ido-mysql.confin . you'll need to update the databasecredentials in this file.
iv. enablingthe IDO MySQL module
# ICINGA2 feature Enable Ido-mysql
Module ' Ido-mysql ' was enabled.
Make sure to restart Icinga 2 for thesechanges to take effect.
# systemctl Restart ICINGA2
b) install Webserver
# yum Install httpd
# Systemctl Enable httpd
# Systemctl Start httpd
i. firewallrules
# Firewall-cmd--add-service=http
# Firewall-cmd--permanent--add-service=http
ii. configuring a command channel outside the amount
The Web interface and some other modules send commands to ICINGA2 through an additional command channel, which you can enable by using the following command:
# ICINGA2 feature enable command
# systemctl Restart ICINGA2
by default, Icingacmd The user group has permission to read and write command channel files, so you need to use the following command to Web The user of the service joins the group:
$ usermod-a-G Icingacmd Apache |
To use the following command to detect whether the user was successfully added to the Icingacmd user groups:
$ id Apache Show uid=48 (Apache) gid=48 (Apache) group =48 (Apache), 989 (Icingacmd) |
c) install Icinga Web2
# yum Installicingaweb2 icingacli
d) Configure Icinga Web2
You can complete the configuration through the IcingaWeb2 Configuration Wizard, or by executing commands directly, this article only describes the configuration Wizard to complete the configuration, if you need to use the command line to complete, please review the Icinga Web 2 official documentation.
STEP1: through icingacli Create a token , used to install ICINGAWEB2 :
ICINGACLI Setup Token Create ICINGACLI Setup Token Show |
STEP 2: access using a browser http://127.0.0.1/icingaweb2/setup ( replace IP with actual IP or domain name), Enter The token from the previous command line into the steup token input box and proceed to the next step.
Image
STEP 3: Select the modules that need to be installed as needed, and I have selected all modules except translations.
Image
STEP 4: According to the results of the system inspection, resolve the items that need to be modified and refresh the confirmation after all.
Image
In this case, there are php time zone, ldap pdo-mysql pdo-postgresql question. pdo-mysql Pdo-postgresql just restart web server can be resolved.
modify php time zone:
use VI open /etc/php.ini ; find date.timezone , delete the front semicolon, add the time zone label at the end, use: Asia/shanghai
enabled LDAP :
Restart Web Server, CentOS7 Direct Use systemctl Restart httpd Reboot .
if it appears The DIRECTORY/ETC/ICINGAWEB2 is not writable. just close SELINUX
Now all the status of the interface should have become green, continue to the next step, the following are not specifically described in the steps are directly click Next!
STEP 5: Configuration Icinga Web2 Database
Image
fill in the form we created here directly ICINGAWEB2 database, by default the user name and password are ICINGAWEB2 . Since we do not give icingaweb2 users permission to create tables, you also need to give a user the ability to create database and table permissions.
Image
STEP 6: Create a Icinga Web2 the Administrator account
Image
STEP 7: Configuration Icingaido Database Information
Image
fill in the form we created here directly Icinga database, by default the user name and password are Icinga . ( This information corresponds to the information that is filled in when you set up a MySQL database operation step)
if it appears /usr/share/icingaweb2/etc/schema/ Mysql.schema.sql files are not found errors, just run
# cp/usr/share/doc/icingaweb2/schema/mysql.schema.sql/usr/share/icingaweb2/etc/schema/
Login!
Image
Centos 7 Installation Icinga2