GNU/Linux >> Tutoriels Linux >  >> Cent OS

Comment configurer Icinga Web 2 sur CentOS 7 / RHEL 7

Cet article couvre l'installation d'Icinga web 2, une interface Web pour Icinga 2 dans laquelle vous surveillez l'ensemble de votre infrastructure en un seul endroit.

Série d'articles

1  :Comment installer Icinga 2 sur CentOS 7 / RHEL 7

2  :Comment configurer Icinga Web 2 sur CentOS 7 / RHEL 7

3  :Comment ajouter des machines Linux distantes dans l'outil de surveillance Icinga 2

Ce guide vous explique comment configurer Icinga 2 avec Icinga web 2. Nous pouvons installer Icinga web 2 soit en utilisant un référentiel officiel, soit à partir de la source en fonction du système d'exploitation.

Exigences

  1. Un serveur Web, par exemple Apache ou Nginx
  2. PHP 5.6.0 et versions ultérieures avec prise en charge de cURL, gettext, intl, mbstring, OpenSSL et XML.
  3. Bibliothèque PHP LDAP lors de l'utilisation de l'authentification LDAP ou Active Directory.
  4. Bibliothèques PHP pour MySQL ou PostgreSQL

Installer PHP et les extensions PHP

Comme indiqué dans les exigences, Icinga Web 2 nécessite PHP version 5.6 et supérieure. La version PHP dont vous avez besoin pour Icinga web 2 est supérieure à celle disponible sur les référentiels de base CentOS / Redhat. Vous devez donc activer le référentiel SCL et le référentiel rhel-server-rhscl-7-rpms sur CentOS et RHEL respectivement.

### CentOS 7 ###

yum install -y centos-release-scl

### RHEL 7 ###

subscription-manager repos --enable rhel-7-server-optional-rpms
subscription-manager repos --enable rhel-server-rhscl-7-rpms

Installez le package PHP et les extensions pour Icinga Web 2.

### CentOS 7  ###

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

### RHEL 7 ###

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

Configurez le fuseau horaire dans le fichier php.ini.

vi /etc/opt/rh/rh-php71/php.ini

Recherchez la ligne ci-dessous et mettez-la à jour avec votre fuseau horaire.

date.timezone = US/Central

Redémarrez le service PHP-FPM.

systemctl restart rh-php71-php-fpm

Activez le service PHP-FPM pour qu'il démarre automatiquement au démarrage du système.

systemctl enable rh-php71-php-fpm

Ajouter le référentiel Icinga 2

Ajoutez le référentiel Icinga 2 sur votre système au cas où vous ne l'auriez pas déjà configuré.

rpm --import https://packages.icinga.com/icinga.key
yum install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm

Installer Icinga Web 2

Utilisez la commande yum sur CentOS/RHEL pour installer le package Icinga Web 2 avec Icinga CLI et le serveur Web Apache.

yum -y install icingaweb2 icingacli httpd

Activez le service Apache pour qu'il démarre automatiquement au démarrage du système.

systemctl enable httpd

SELinux

Si vous exécutez Icinga Web 2 avec SELinux activé, envisagez d'installer le package ci-dessous pour définir la politique d'Icinga Web 2.

yum -y install icingaweb2-selinux

Pare-feu

Exécutez les commandes ci-dessous pour autoriser le trafic HTTP à accéder à Icinga Web 2 à partir de machines externes.

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

Préparer l'installation d'Icinga Web 2

Icinga CLI est utilisé pour effectuer des tâches d'administration dans la ligne de commande. Icinga Web 2 et CLI doivent avoir accès aux journaux et aux configurations. Ajouter l'utilisateur du serveur Web (apache au groupe système (icingaweb2)

groupadd -r icingaweb2
usermod -a -G icingaweb2 apache

Créez le répertoire de configuration d'Icinga Web 2.

icingacli setup config directory --group icingaweb2

Redémarrez les services Apache et PHP-FPM.

systemctl restart httpd
systemctl restart rh-php71-php-fpm

Assistant de configuration d'Icinga Web 2

Lorsque vous visitez Icinga Web 2 pour la première fois, l'assistant de configuration Web d'Icinga vous guidera à travers toutes les étapes pour une installation réussie d'Icinga Web 2.

http://votre.ip.addr.ess/icingaweb2/setup

Pour des raisons de sécurité, vous devrez générer le jeton pour l'installation d'Icinga Web 2.

Générez le jeton à l'aide de la commande suivante.

icingacli setup token create

Sortie :

The newly generated setup token is: 04fa4ea1baf4f0b9

Copiez et collez le jeton généré sur la page de configuration et cliquez sur Suivant .

Pages :1 2 3 4
Cent OS
  1. Comment installer Icinga 2 sur CentOS 8 / RHEL 8

  2. Configurer l'outil de surveillance Icinga sur CentOS 7 / RHEL 7

  3. Comment configurer le serveur SysLog sur CentOS 7 / RHEL 7

  4. Comment configurer le serveur NFS sur CentOS 7 / RHEL 7

  5. Comment configurer mutt dans CentOS/RHEL

Comment configurer Icinga Web 2 sur CentOS 8 / RHEL 8

Comment installer Jetty Web Server sur CentOS 7 / RHEL 7

Comment configurer un Chef 12 sur CentOS 7 / RHEL 7

Comment configurer le serveur SysLog centralisé sur CentOS 8 / RHEL 8

Comment configurer Icinga Web 2 sur Ubuntu 18.04 / Ubuntu 16.04 / Debian 9

Comment configurer la réplication MySQL dans RHEL/Centos