====== Installation de Shinken sur CentOS ======

Voici la procédure pour mettre en place un serveur de supervision Shinken sur CentOS (avec LiveStatus et Thruk).

**Cette page a été rédigée par :**

^ **Rôle**                          ^ **Nom**          ^
| **Rédacteur**                    |    Thibaut LAGORCE    |
| **Rédacteur**                    |    Jean    Gabès      |

==== TÉLÉCHARGEMENT DES SOURCES ====

<code>wget http://shinken-monitoring.org/pub/shinken-0.5.1.tar.gz
tar zxvf shinken-0.5.1.tar.gz</code>

==== INSTALLATION DES PREREQUIS ====

<code>yum install python-setuptools python-devel MySQL-python libffi python-simplejson python-sqlite2</code>
__
**Installation de Pyro**__
<code>wget http://pypi.python.org/packages/source/P/Pyro/Pyro-3.10.tar.gz
tar zxvf Pyro-3.10.tar.gz
cd Pyro-3.10
python setup.py install</code>

==== AJOUT DE L'UTILISATEUR & GROUPE ====

<code>groupadd shinken
useradd -g shinken -G apache -d /usr/local/shinken/ shinken
passwd shinken
passwd -x -1 shinken</code>

==== CONFIGURATION AVANT INSTALLATION ====

<code>mkdir /usr/local/shinken
chown -R shinken:shinken /usr/local/shinken/</code>

<code>vi /images/shinken-0.5.1/setup_parameters.cfg</code>

<code>[etc]
path=/usr/local/shinken/etc
owner=shinken
group=shinken

[var]
path=/usr/local/shinken/var
owner=shinken
group=shinken

[libexec]
path=/usr/local/shinken/libexec
owner=shinken
group=shinken</code>

==== INSTALLATION DE SHINKEN ====

<code>python setup.py install --install-scripts=/usr/local/shinken/bin</code>

**==> Avant de lancer Shinken nous allons installer les plugins**

==== INSTALLATION PLUGINS ====

<code>wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz
tar xvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15</code>

<code>./configure --prefix=/usr/local/shinken --with-nagios-user=shinken --with-nagios-group=shinken --enable-libtap --enable-extra-opts --enable-perl-modules
make
make install</code>

==== TEST DE LANCEMENT / FONCTIONNEMENT SHINKEN ====

<code>/etc/init.d/shinken-scheduler start
/etc/init.d/shinken-poller start
/etc/init.d/shinken-broker start
/etc/init.d/shinken-reactionner start
/etc/init.d/shinken-arbiter start</code>

__**Vérification des LOGS :**__
<code>ps -fu shinken
tail -f /usr/local/shinken/var/nagios.log</code>



==== INSTALLATION DE L'INTERFACE WEB THRUK ====

<code>arch=$(perl -e 'use Config; print $Config{archname}')
vers=$(perl -e 'use Config; print $Config{version}')
wget http://www.thruk.org/files/Thruk-0.82-$arch-$vers.tar.gz
tar zxf Thruk-0.82-$arch-$vers.tar.gz
cd Thruk-0.82
mkdir /usr/local/shinken/Thruk/
cp -R /images/Thruk-0.82/* /usr/local/shinken/Thruk/
chown -R shinken:shinken /usr/local/shinken/Thruk</code>

<code>vi /usr/local/shinken/Thruk/thruk.conf</code>

<code><peer>
    name   = SHINKEN
    type   = livestatus
    <options>
        peer    = 127.0.0.1:50000
    </options>
</peer></code>

__**Lancement de thruk**__
<code>/usr/local/shinken/Thruk/script/thruk_server.pl</code>

__**Accès à l'interface Thruk**__
<code>http://@IP_SERVEUR:3000/</code>