安装repo
For Centos 8:
dnf -y install https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm
CentOS 8 additionally needs the PowerTools repository for EPEL:
dnf -y install 'dnf-command(config-manager)'
dnf config-manager --set-enabled PowerTools
dnf -y install epel-release
安装Icinga 2
dnf -y install icinga2
systemctl enable icinga2
systemctl start icinga2
配置plugins
dnf install nagios-plugins-all
安装Icinga Web 2
DB (Postgresql)
dnf -y install postgresql-server postgresql
postgresql-setup initdb
systemctl enable postgresql
systemctl start postgresql
icinga for postgresql
Installing the IDO modules for PostgreSQL
dnf -y install icinga2-ido-pgsql
Set up a PostgreSQL database for Icinga 2:
cd /tmp
sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'"
sudo -u postgres createdb -O icinga -E UTF8 icinga
vim /var/lib/pgsql/data/pg_hba.conf
# icinga
local icinga icinga md5
host icinga icinga 127.0.0.1/32 md5
host icinga icinga ::1/128 md5
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
systemctl restart postgresql
export PGPASSWORD=icinga
psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
Enabling the IDO PostgreSQL module
icinga2 feature enable ido-pgsql
systemctl restart icinga2
Web server
dnf -y install httpd
systemctl enable httpd
systemctl start httpd