utorok 3. marca 2020

icinga2 na centos7

Inštalácia icingy na CentOS7




1. pridáme epel repozitár, spravíme update a reboot


 yum install epel-release -y
 yum update -y
 reboot

2.  Nainštalujeme apache www server a ssl module, aby sme mali https


 yum install httpd -y
yum install mod_ssl


3. upravíme www apachu 


 sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf






4. naštartujeme httpd a takisto enable

  systemctl start httpd
  systemctl status httpd
  systemctl enable httpd


5. nainštalujeme mariadb a mariadb server


yum install mariadb mariadb-server -y

6. naštartujeme a enableujeme mariadb


systemctl start mariadb
systemctl enable mariadb

7. spravíme secure mysql instalaciu


/usr/bin/mysql_secure_installation

a v nej si vytvorime nove heslo na roota pre mysql (mariadb)

(odenterujeme, nastavíme nové heslo a potvrdíme, nech zmaže staré veci, atď)







8. Poďme na PHP :-) 


Doinštalujem si závislosti a nástroje:

 yum install epel-release yum-utils
  yum install wget
  yum install centos-release-scl
  yum install epel-release yum-utils

yum install rh-php71-php-mysqlnd rh-php71-php-cli php-Icinga rh-php71-php-common rh-php71-php-fpm rh-php71-php-pgsql rh-php71-php-ldap rh-php71-php-intl rh-php71-php-xml rh-php71-php-gd rh-php71-php-pdo rh-php71-php-mbstring -y


stiahneme si remi repozitár a pomocou yum-config manažéra mu dáme, nech si ťahá php71

 yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 yum-config-manager --enable remi-php71
 yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd

yum install php php-gd php-intl php-ldap php-ZendFramework php-ZendFramework-Db-Adapter-Pdo-Mysql -y



[root@reserv-15-vpn-fw yum.repos.d]# php -v
PHP 7.1.33 (cli) (built: Feb 18 2020 07:15:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.33, Copyright (c) 1999-2018, by Zend Technologies
[root@reserv-15-vpn-fw yum.repos.d]#

9. upravíme časovú zónu


vi /etc/php.ini

date.timezone = Europe/Prague


10. reštartujeme apache

systemctl restart httpd.service

11. pozrime sa na status apache

systemctl status httpd


12. nainštalujeme icingu


  rpm --import http://packages.icinga.org/icinga.key
  rpm -i http://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm
  yum install icinga2 nagios-plugins-all -y
 





13. spustíme a enable icinga2

  systemctl start icinga2.service
  systemctl enable icinga2.service
 

14. chceckneme, či sú zapnuté: checker, mainlog, and notification.


icinga2 feature list

15. nainštalujeme icinga2 modul pre mysql


yum install icinga2-ido-mysql -y

16. vytvorime databazu pre 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 'icinga';
FLUSH PRIVILEGES;
EXIT;




17. importujeme schému do db


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


18. zapneme IDO MySQL module


vi /etc/icinga2/features-available/ido-mysql.conf

 //user = "icinga"
//password = "icinga"
//host = "localhost"
//database = "icinga"

zmeníme, aby bolo:

user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"

19. enableujeme ido-mysql

icinga2 feature enable ido-mysql

systemctl restart icinga2.service

20. inštalujeme icinga2 web2, tj. web prostredie pre icingu


icinga2 feature enable command

systemctl restart icinga2.service


21. pridáme užívateľa apache do skupiny icingacmd a skontrolujeme


 usermod -a -G icingacmd apache

 id apache

22. nainštalujeme balíčky 


yum install icingaweb2 icingacli -y

23. nastavíme webserver apache


icingacli setup config webserver apache --document-root /usr/share/icingaweb2/public

systemctl restart httpd.service

24. vygenerujeme si token


 icingacli setup token create

25. pokračujeme vo www


http://<your-server-ip>/icingaweb2/setup









Žiadne komentáre:

Zverejnenie komentára