How to configure ICINGA2 Monitoring server on CentOS / RHEL 7

Before we start to configure ICINGA2 we need to ensure that LAMP is installed on our machine.

SELINUX Setup

view /etc/selinux/config
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

reboot

NTP setup

yum install ntp
vi /etc/ntp.conf

restrcit 127.0.0.1

systemctl start ntpd
 ntpq -p

yum install php-ldap

vi /etc/php.ini

date.timezone = Asia/Karachi
rpm -i http://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm
yum install icinga2
systemctl enable icinga2

systemctl start icinga2

systemctl status icinga2

mysql -u root -p

create database icinga;

GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'pakistani@!';
 flush privileges;


exit





yum install icinga2-ido-mysql

ls -l /usr/share/icinga2-ido-mysql/schema/

mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql

 

[root@localhost ~]#icinga2 feature list

if disable please enable using below command

[root@localhost ~]#icinga2 feature enable ido-mysql

[root@localhost ~]#icinga2 feature enable command

[root@localhost ~]#systemctl restart icinga2

[root@localhost ~]#yum install icingaweb2 icingacli
 [root@localhost ~]#chcon -R -t httpd_sys_rw_content_t /etc/icingaweb2/

[root@localhost ~]#systemctl restart httpd


 ------------------------------------------

Restart Icinga2:
# systemctl restart icinga2

Finaly you will want to add the apache user to the icingacmd group because the command pipe file is owned by that group:

# usermod -a -G icingacmd apache
Verify the apache user:
# id apache
uid=48(apache) gid=48(apache) groups=48(apache),992(icingacmd)
yum -y install icingaweb2 icingacli

icingacli setup token create

Now create new db for web interface

mysql -u root -p

create database icingaweb_db;

GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icingaweb_db.* TO 'icinga'@'localhost' IDENTIFIED BY 'pakistani@!';
 one level is icingaweb_db

root

pass

On next level

After this we need to use  icinga on next database using user icinga

---------------------------------------------------------
 192.168.122.54/icingaweb2/setup
[root@localhost ~]#groupadd -r icingaweb2;

[root@localhost ~]#usermod -a -G icingaweb2 apache;
[root@localhost ~]#yum install icingacli

icingacli setup config directory --group icingaweb2;
icingacli setup token create;
The newly generated setup token is: b2e2769fe05552a2 copy token text and add to your token area
[root@localhost ~]#firewall-cmd --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=http

Now you need to open page

your-server-ip/icingaweb2/setup

yum install nagios-plugins-all
touch /var/www/html/index.html

now setting clients on server

firewall-cmd --permanent --add-port=5665/tcp
firewall-cmd --permanent --add-port=5665/udp
firewall-cmd --reload

icinga2 node wizard
 n

babar

client side configuration

centos 7

rpm -i http://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm

yum install icinga2

now configure epel repo

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install nagios-plugins-all

firewall-cmd --permanent --add-port=5665/tcp
firewall-cmd --permanent --add-port=5665/udp

firewall-cmd --reload

systemctl restart icinga2
[root@localhost ~]#firewall-cmd --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=http

 

Recommended For You.

Introduction Systemd is an init system and system manager that is widely becoming the new standard for Linux machines. While there