This script is based on a foreign website (the script uses the appropriate CentOS system to solve the support library to solve the dependency problem. )
#!/bin/bash
#instalation des packages necessaires
# Installation of Packages
Yum Install xterm
Yum install php php-cli rrdtool librrds-perl php5-gd gcc make tomcat6 perl-* perl *-perl php-pear php-xmlrpc php-xsl php-p Do php-soap php-gd php-ldap php-mysql httpd gcc glibc glibc-common gd gd-devel libjpeg libjpeg-devel libpng libpng-devel N Et-snmp net-snmp-devel net-snmp-utils mysql mysql-server libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql PostgreSQL Postgresql-server libdbi libdbi-devel libdbi-drivers libdbi-dbd-pgsql
# Creation d ' un dossier pour l ' installation
# Creation of directory for installation
Xterm-e Mkdir/icinga
# Creation d ' un compte utilisateur et du groupe
# Creation of user account
Useradd-m Icinga
echo "
# entrez le mot de passe pour l ' utilisateur icinga
Le mot de passe est:icinga
# Enter password for Icinga user
The password Is:icinga
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
XTERM-E passwd icinga&
Groupadd Icinga
Groupadd Icinga-cmd
Usermod-a-G Icinga-cmd Icinga
Usermod-a-G Icinga-cmd Apache
# téléchargement des sources
# Download of sources
cd/usr/src/
XTERM-E wget http://garr.dl.sourceforge.net/project/icinga/icinga-web/1.10.0/icinga-web-1.10.0.tar.gz&
XTERM-E wget http://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz&
XTERM-E wget http://garr.dl.sourceforge.net/project/icinga/icinga/1.10.1/icinga-1.10.1.tar.gz&
cd/usr/src/
Clear
echo "
Telechargement en cours * * * * *
Downloads is Process * * * * *
"
Wait
# compilation et installation d ' Icinga Core
# Compilation and installtion of Icinga Cor
cd/usr/src/
Tar xzvf icinga-1.10.1.tar.gz
CD ICINGA-1.10.1/
./configure
Make all
Make install
Make Install-init
Make Install-config
Make Install-eventhandlers
Make Install-commandmode
Make Install-idoutils
cd/usr/local/icinga/etc/
CP Idomod.cfg-sample Idomod.cfg
CP Ido2db.cfg-sample Ido2db.cfg
/etc/init.d/mysqld start
echo "
# initialisation de la base de données entrez les commandes
# suivantes sur MySQL
# Initialize Data Base Enter following commands on MySQL
##############################
CREATE DATABASE Icinga;
GRANT USAGE on icinga.* to ' icinga ' @ ' localhost '
Identified by ' Icinga '
With Max_queries_per_hour 0
Max_connections_per_hour 0
Max_updates_per_hour 0;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE
On icinga.* to ' icinga ' @ ' localhost ';
FLUSH privileges;
Quit
##############################
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Mysql-u Root
Wait
cd/usr/src/icinga-1.10.1/module/idoutils/db/mysql/
Mysql-u Root Icinga < Mysql.sql
# Gestion des modules Cassé
# Management of broken modules
Cp/usr/local/icinga/etc/modules/idoutils.cfg-sample/usr/local/icinga/etc/modules/idoutils.cfg
# Configuration de l ' interface Web Classic
# configurationof Classic Web interface
Cd/usr/src/icinga-1.10.1/
Make CGIs
Make Install-cgis
Make install-html
Make install-webconf
# Creation du compte admin
# Creation of Admin Account
echo "
# entrez le mot de passe pour l ' utilisateur icingaadmin
# Enter password for icingaadmin user
# Ce mot de passe sera utilisépour l ' interface web
# that password'll be the use for Web interface
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Xterm-e htpasswd-c/usr/local/icinga/etc/htpasswd.users icingaadmin&
Wait
# redemarrage du service web
# Restartweb Service
Service httpd Restart
# compilation et installation des plugin pour nagios
# Compilation and installation of plugin for Nagios
Cd/usr/src
Tar xvzf nagios-plugins-1.5.tar.gz
CD nagios-plugins-1.5
./configure--prefix=/usr/local/icinga \
--with-cgiurl=/icinga/cgi-bin \
--with-nagios-user=icinga--with-nagios-group=icinga
Make
Make install
# modification Temporaire des parametres System
# Temporary modification of system settings
Getenforce
Setenforce 0
Chcon-r-T httpd_sys_script_exec_t/usr/local/icinga/sbin/
Chcon-r-T Httpd_sys_content_t/usr/local/icinga/share/
# Redémarrage et Sauvegarde
# Restart and save new services
For i in mysqld ido2db Icinga httpd; do/etc/init.d/$i Restart; Done
For i in mysqld ido2db Icinga httpd; Do chkconfig--add $i; Chkconfig $i on; Done
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
################################################################################################
# ICINGA WEB
# compilation et instalation
# Compilation and Installation
cd/usr/src/
Tar xvzf icinga-web-1.10.0.tar.gz
cd/usr/src/icinga-web-1.10.0/
./configure--prefix=/usr/local/icinga-web--with-db-type=mysql--with-db-host=localhost--with-db-port=3306-- With-db-name=icinga_web--with-db-user=icinga_web--with-db-pass=icinga_web
Make install
Make Install-apache-config
Make Install-javascript
Make Install-done
Make Testdeps
# Configuration de la BD pour icingaweb
# Configuration of Data Base for Icinga Web
echo "
# initialisation de la base de données entrez les commandes
# suivantes sur MySQL
# Initialize Data Base Enter following commands on MySQL
##############################
CREATE DATABASE Icinga_web;
GRANT USAGE on * * to ' icinga_web ' @ ' localhost '
Identified by ' Icinga_web '
With Max_queries_per_hour 0
Max_connections_per_hour 0
Max_updates_per_hour 0;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX on icinga_web.* to ' icinga_web ' @ ' localhost ';
FLUSH privileges;
Quit
##############################
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Mysql-u Root
Wait
echo "
# initialisation de la base de données
# Initialize Data Base
Acceptez Tout
Accept All
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
XTERM-E make db-initialize&
Wait
For i in mysqld ido2db icinga httpd crond snmpd SNMPTRAPD; do/etc/init.d/$i Restart; Done
echo "
# change Idomod.cfg
#use_ssl =1
#output_type =tcpsocket
#output =127.0.0.1
# change Ido2db.cfg
#use_ssl =1
#socket_type =tcp
# pour sauvegarder = Echap:wq
# to Save = Echap:wq
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Xterm-e vim/usr/local/icinga/etc/ido2db.cfg&
Xterm-e vim/usr/local/icinga/etc/idomod.cfg&
Wait
echo "
# ******* Idoutils.cfg **********
# Ajouter/modifier
# add/upadate
# define Module{
# module_name Ido_mod
# path/usr/local/icinga/lib/idomod.so
# Module_type NEB
# args Config_file=/usr/local/icinga/etc/idomod.cfg
# }
# pour sauvegarder = Echap:wq
# to Save = Echap:wq
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Xterm-e vim/usr/local/icinga/etc/modules/idoutils.cfg&
Wait
echo "
# pour enregistrer les parametres systeme de Maniere permanente
# changer
Selinux=enforcing
#par
Selinux=disabled
# To save system settings
# change
Selinux=enforcing
#by
Selinux=disabled
******************************************
# pour sauvegarder = Echap:wq
# to Save = Echap:wq
Fermer la fenetre apres avoir fini ******
Close windows if you finish ******
">/icinga/tempo
Xterm-e vim/icinga/tempo&
Xterm-e vim/etc/sysconfig/selinux&
Wait
For i in mysqld ido2db icinga httpd crond snmpd SNMPTRAPD; do/etc/init.d/$i Restart; Done
Scrip Install Icinga PHP