Outils personnels

Installation de Shinken sur une Debian : Différence entre versions

De wikiGite

 
(55 révisions intermédiaires par 3 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
−
Version Arch & Perl
+
= Installation par script (depuis v1.0) =
−
perl -e 'use Config; print "$Config{archname} \n"'
+
Doc officielle : http://www.shinken-monitoring.org/wiki/shinken_10min_start
−
perl -e 'use Config; print "$Config{version} \n"'
 
  
−
  Configuration file folder : /etc/shinken
+
Installation des pré-requis :
−
  Log file : /var/lib/shinken/nagios.log
+
<!-- apt-get install build-essential python python-dev python-setuptools pyro libgd2-xpm-dev git-core lsb-release ---- peut-être pas nécessaire ? A vérifier -->
−
  Shinken startup script : /etc/init.d/shinken
+
apt-get install lsb-release pyro
−
  Thruk web interface URL : http://<hostname>:3000
+
useradd --user-group shinken
 +
usermod --lock shinken
 +
Téléchargement de Shinken et des plugins :
 +
mkdir /root/install
 +
cd /root/install
 +
* Version stable :
 +
  wget <nowiki>http://shinken-monitoring.org/pub/shinken-1.2.tar.gz</nowiki>
 +
tar -xvzf shinken-1.2.tar.gz
 +
* ou version en cours de développement, pour tests :
 +
  git clone <nowiki>https://github.com/naparuba/shinken</nowiki>
 +
<!-- ''Note : en cas d'erreur SSL :
 +
error: SSL certificate problem, verify that the CA cert is OK. Details:
 +
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/naparuba/shinken/info/refs
 +
  fatal: HTTP request failed
 +
Ajouter cette variable d'environnement avant git :
 +
env GIT_SSL_NO_VERIFY=true git clone https://github.com/naparuba/shinken -->
 +
Installation de Shinken :
 +
cd shinken*
 +
<!-- python setup.py install --install-scripts=/usr/bin -->
 +
./install -i && ./install -p nagios-plugins && ./install -a pnp4nagios
  
−
Pour relancer Shinken:
+
* Fichiers de Configuration :  /usr/local/shinken/etc/shinken
 +
* Fichier log : /usr/local/shinken/var/lib/shinken/nagios.log
 +
* Plugins Shinken + Nagios : /usr/local/shinken/libexec
 +
 
 +
'''NOTE''' : on peut installer tous les modules disponibles par :
 +
./install -i && ./install -p nagios-plugins && ./install -p check_mem && ./install -p manubulon && ./install -a multisite && ./install -a pnp4nagios
 +
Attention multisite et pnp4nagios sont des add-ons ("-a") pas des plugins ("-p"). Si quelqu'un sait la différence...
 +
 
 +
<!-- Démarrage de Shinken :
 +
/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
 +
/etc/init.d/shinken-receiver start -->
 +
Si nécessaire, pour relancer Shinken :  
 
  /etc/init.d/shinken restart
 
  /etc/init.d/shinken restart
  
−
------------------------------------------------------------------------
+
Test de l'installation :
 +
<nowiki>https://<hostname>:7767</nowiki>
 +
Si ça n'a pas déjà été fait par le script d'installation, créer un lien de la configuration de Shinken, /usr/local/shinken/etc vers /etc/shinken
 +
ln -s /usr/local/shinken/etc /etc/shinken
 +
 
 +
Si PNP4NAGIOS a été installé, penser à lancer le démon NPCD
 +
/etc/init.d/npcd restart
 +
 
 +
= Mise à jour =
 +
Comme pour l'installation, charger la dernière version de Shinken par wget. Puis dans le répertoire de l'archive décompressée :
 +
./install -b # Backup configuration
 +
./install -u # Uninstall Shinken
 +
./install -i # Install new version
 +
./install -l # List backups
 +
./install -r <backup_id> # Restore last backup
 +
 
 +
= Configuration =
 +
Le fichier de mots de passe par défaut est /etc/shinken/htpasswd.users (donc /usr/local/shinken/etc/htpasswd.users). Ajouter un utilisateur admin pour l'accès au WebUI :
 +
htpasswd /etc/shinken/htpasswd.users admin
  
−
If you follow these instructions, here's what you'll end up with:
+
Vérification des fichiers de configuration de Shinken :
 +
/usr/local/shinken/bin/shinken-arbiter -v -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg
  
−
Shinken and the plugins will be installed underneath
+
= Plugins =
−
”/usr/local/shinken”
 
  
−
Required Packages
+
Installation des plugins Nagios :
−
  sudo apt-get install python pyro git-core python-setuptools
+
  apt-get install nagios-plugins
−
  apt-get install python python-dev python-setuptools pyro libgd2-xpm-dev nagios-plugins git-core
+
  cp /usr/lib/nagios/plugins/* /usr/local/shinken/libexec/
  
−
Create Account Information
+
Les plugins supplémentaires sont identiques à ceux de Nagios : http://exchange.nagios.org/
  
−
Become the root user.
+
= pnp4nagios =
−
sudo su -
+
Cet add-on permet d'avoir des graphes de performances calculés à partir des informations récoltées par Shinken. Il est désormais installé par le script "install" de Shinken.
  
−
Create a new shinken user account and give it a password.
+
Pour plus de détails, voir [[Installation_de_PNP4Nagios]]
 +
 
 +
 
 +
-------------------------------------------------
 +
 
 +
= ''Pour archive'' Installation par script Nicolargo =
 +
You can use the very good installation script from Nicolargo! Thanks a lot to him :)
 +
    wget https://raw.github.com/nicolargo/shinkenautoinstall/master/shinkenautoinstall-debian.sh
 +
    chmod a+x shinkenautoinstall-debian.sh
 +
    sudo ./shinkenautoinstall-debian.sh
 +
 
 +
-------------------------------------------------
 +
= ''Pour archive'' Procédure manuelle =
 +
Installation des pré-requis :
 +
apt-get install build-essential python python-dev python-setuptools pyro libgd2-xpm-dev git-core
 +
 
 +
Se logguer en tant que root :
 +
su -
 +
 
 +
Création de l'utilisateur shinken (avec le mot de passe) :
 
  /usr/sbin/useradd -m shinken
 
  /usr/sbin/useradd -m shinken
 
  passwd shinken
 
  passwd shinken
  
−
On Ubuntu server edition (9.10 and possible newer versions), you will need to also add a shinken group (it's not created by default). You should be able to skip this step on desktop editions of Ubuntu.
+
(/usr/sbin/groupadd shinken) : Pas nécessaire.
−
/usr/sbin/groupadd shinken
 
 
  /usr/sbin/usermod -G shinken shinken
 
  /usr/sbin/usermod -G shinken shinken
  
−
Add the apache user to this group to allow external commands to be send from the web interface.
 
 
  /usr/sbin/usermod -G shinken www-data
 
  /usr/sbin/usermod -G shinken www-data
  
−
Download Shinken and the Plugins
+
Téléchargement de Shinken et des plugins :
−
 
 
−
Create a directory for storing the downloads.
 
 
  mkdir ~/downloads
 
  mkdir ~/downloads
 
  cd ~/downloads
 
  cd ~/downloads
  
−
Download the source code of Shinken and the Shinken plugins (visit http://www.nagios.org/download/ for links to the latest versions of the plugins). At the time of writing, the latest versions plugins were 1.4.13.
+
/*git clone git://shinken.git.sourceforge.net/gitroot/shinken/shinken*/
−
git clone git://shinken.git.sourceforge.net/gitroot/shinken/shinken
+
git clone https://github.com/naparuba/shinken
  
−
Install Shinken (repasser en utilisateur normal)
+
Installation de Shinken :
 
  cd shinken
 
  cd shinken
 
  python setup.py install --install-scripts=/usr/bin
 
  python setup.py install --install-scripts=/usr/bin
  
−
Don't start Shinken yet - there's still more that needs to be done…
+
Installation des plugins Nagios :
−
Customize Configuration
+
apt-get install nagios-plugins
−
 
 
−
Sample configuration files have now been installed in the ”/etc/shinken/” directory. These sample files should work fine for getting started with Shinken. You'll need to make just one change before you proceed…
 
−
Install the Nagios Plugins to use with Shinken
 
−
 
 
−
You can download plugins from source, but your debian-like administrator will just will you :
 
 
  cp libexec/* /usr/lib/nagios/plugins/
 
  cp libexec/* /usr/lib/nagios/plugins/
  
−
Start Shinken
+
Configuration du lancement automatique de Shinken au démarrage du système :
−
 
 
−
Configure Shinken to automatically start when the system boots.
 
 
  ln -s /etc/init.d/shinken-scheduler /etc/rcS.d/S98shinken-scheduler
 
  ln -s /etc/init.d/shinken-scheduler /etc/rcS.d/S98shinken-scheduler
 
  ln -s /etc/init.d/shinken-poller /etc/rcS.d/S98shinken-poller
 
  ln -s /etc/init.d/shinken-poller /etc/rcS.d/S98shinken-poller
Ligne 68 : Ligne 127 :
 
  ln -s /etc/init.d/shinken-broker /etc/rcS.d/S98shinken-broker
 
  ln -s /etc/init.d/shinken-broker /etc/rcS.d/S98shinken-broker
 
  ln -s /etc/init.d/shinken-arbiter /etc/rcS.d/S98shinken-arbiter
 
  ln -s /etc/init.d/shinken-arbiter /etc/rcS.d/S98shinken-arbiter
 +
ln -s /etc/init.d/shinken-receiver /etc/rcS.d/S98shinken-receiver
  
−
Verify the sample Shinken configuration files.
+
Vérification des fichiers de configuration de Shinken :
−
  /usr/bin/shinken-arbiter -v -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg
+
  /usr/local/shinken/bin/shinken-arbiter -v -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg
  
−
If there are no errors, start Shinken.
+
Démarrage de Shinken :
 
  /etc/init.d/shinken-scheduler start
 
  /etc/init.d/shinken-scheduler start
 
  /etc/init.d/shinken-poller start
 
  /etc/init.d/shinken-poller start
Ligne 78 : Ligne 138 :
 
  /etc/init.d/shinken-reactionner start
 
  /etc/init.d/shinken-reactionner start
 
  /etc/init.d/shinken-arbiter start
 
  /etc/init.d/shinken-arbiter start
 +
/etc/init.d/shinken-receiver start
 +
 +
Si nécessaire, pour relancer Shinken :
 +
/etc/init.d/shinken restart
 +
 +
*Fichiers de Configuration :  /etc/shinken
 +
*Fichier log : /var/lib/shinken/nagios.log
 +
*Plugins Nagios : /usr/lib/nagios/plugins/

Version actuelle datée du 27 septembre 2012 à 08:48

Installation par script (depuis v1.0)

Doc officielle : http://www.shinken-monitoring.org/wiki/shinken_10min_start

Installation des pré-requis :

apt-get install lsb-release pyro
useradd --user-group shinken
usermod --lock shinken

Téléchargement de Shinken et des plugins :

mkdir /root/install
cd /root/install
  • Version stable :
wget http://shinken-monitoring.org/pub/shinken-1.2.tar.gz
tar -xvzf shinken-1.2.tar.gz
  • ou version en cours de développement, pour tests :
git clone https://github.com/naparuba/shinken

Installation de Shinken :

cd shinken*
./install -i && ./install -p nagios-plugins && ./install -a pnp4nagios
  • Fichiers de Configuration : /usr/local/shinken/etc/shinken
  • Fichier log : /usr/local/shinken/var/lib/shinken/nagios.log
  • Plugins Shinken + Nagios : /usr/local/shinken/libexec

NOTE : on peut installer tous les modules disponibles par :

./install -i && ./install -p nagios-plugins && ./install -p check_mem && ./install -p manubulon && ./install -a multisite && ./install -a pnp4nagios

Attention multisite et pnp4nagios sont des add-ons ("-a") pas des plugins ("-p"). Si quelqu'un sait la différence...

Si nécessaire, pour relancer Shinken :

/etc/init.d/shinken restart

Test de l'installation :

https://<hostname>:7767

Si ça n'a pas déjà été fait par le script d'installation, créer un lien de la configuration de Shinken, /usr/local/shinken/etc vers /etc/shinken

ln -s /usr/local/shinken/etc /etc/shinken

Si PNP4NAGIOS a été installé, penser à lancer le démon NPCD

/etc/init.d/npcd restart

Mise à jour

Comme pour l'installation, charger la dernière version de Shinken par wget. Puis dans le répertoire de l'archive décompressée :

./install -b # Backup configuration
./install -u # Uninstall Shinken
./install -i # Install new version
./install -l # List backups
./install -r <backup_id> # Restore last backup

Configuration

Le fichier de mots de passe par défaut est /etc/shinken/htpasswd.users (donc /usr/local/shinken/etc/htpasswd.users). Ajouter un utilisateur admin pour l'accès au WebUI :

htpasswd /etc/shinken/htpasswd.users admin

Vérification des fichiers de configuration de Shinken :

/usr/local/shinken/bin/shinken-arbiter -v -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg

Plugins

Installation des plugins Nagios :

apt-get install nagios-plugins
cp /usr/lib/nagios/plugins/* /usr/local/shinken/libexec/

Les plugins supplémentaires sont identiques à ceux de Nagios : http://exchange.nagios.org/

pnp4nagios

Cet add-on permet d'avoir des graphes de performances calculés à partir des informations récoltées par Shinken. Il est désormais installé par le script "install" de Shinken.

Pour plus de détails, voir Installation_de_PNP4Nagios



Pour archive Installation par script Nicolargo

You can use the very good installation script from Nicolargo! Thanks a lot to him :)

   wget https://raw.github.com/nicolargo/shinkenautoinstall/master/shinkenautoinstall-debian.sh
   chmod a+x shinkenautoinstall-debian.sh
   sudo ./shinkenautoinstall-debian.sh

Pour archive Procédure manuelle

Installation des pré-requis :

apt-get install build-essential python python-dev python-setuptools pyro libgd2-xpm-dev git-core

Se logguer en tant que root :

su -

Création de l'utilisateur shinken (avec le mot de passe) :

/usr/sbin/useradd -m shinken
passwd shinken
(/usr/sbin/groupadd shinken) : Pas nécessaire.
/usr/sbin/usermod -G shinken shinken
/usr/sbin/usermod -G shinken www-data

Téléchargement de Shinken et des plugins :

mkdir ~/downloads
cd ~/downloads
/*git clone git://shinken.git.sourceforge.net/gitroot/shinken/shinken*/
git clone https://github.com/naparuba/shinken

Installation de Shinken :

cd shinken
python setup.py install --install-scripts=/usr/bin

Installation des plugins Nagios :

apt-get install nagios-plugins
cp libexec/* /usr/lib/nagios/plugins/

Configuration du lancement automatique de Shinken au démarrage du système :

ln -s /etc/init.d/shinken-scheduler /etc/rcS.d/S98shinken-scheduler
ln -s /etc/init.d/shinken-poller /etc/rcS.d/S98shinken-poller
ln -s /etc/init.d/shinken-reactionner /etc/rcS.d/S98shinken-reactionner
ln -s /etc/init.d/shinken-broker /etc/rcS.d/S98shinken-broker
ln -s /etc/init.d/shinken-arbiter /etc/rcS.d/S98shinken-arbiter
ln -s /etc/init.d/shinken-receiver /etc/rcS.d/S98shinken-receiver

Vérification des fichiers de configuration de Shinken :

/usr/local/shinken/bin/shinken-arbiter -v -c /etc/shinken/nagios.cfg -c /etc/shinken/shinken-specific.cfg

Démarrage de Shinken :

/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
/etc/init.d/shinken-receiver start

Si nécessaire, pour relancer Shinken :

/etc/init.d/shinken restart
  • Fichiers de Configuration : /etc/shinken
  • Fichier log : /var/lib/shinken/nagios.log
  • Plugins Nagios : /usr/lib/nagios/plugins/