Outils pour utilisateurs

Outils du site


start:developpement:joomla:nagioscheck4updates

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
start:developpement:joomla:nagioscheck4updates [2012/12/07 16:39]
fufroma
start:developpement:joomla:nagioscheck4updates [2012/12/07 16:45] (Version actuelle)
fufroma
Ligne 14: Ligne 14:
   * http://​www.neuronnexion.fr/​logiciels-libres/​composant-joomla-nagioscheck4updates   * http://​www.neuronnexion.fr/​logiciels-libres/​composant-joomla-nagioscheck4updates
  
-==== Intégration dans Nagios ==== +===== Intégration dans Nagios ​===== 
-=== Wrapper Nagios ===+==== Wrapper Nagios ​====
 <code bash /​usr/​local/​bin/​check_joomla_upgrade>​ <code bash /​usr/​local/​bin/​check_joomla_upgrade>​
 #!/bin/bash #!/bin/bash
  
-Recupere le status de la sonde d'​upgrade joomla +Wrapper for nagioscheck4updates 
-Simple page sans balise ​:  +Documentationhttp://​tech.nnx.com/​doku.php?​id=start:​developpement:​joomla:​nagioscheck4updates 
-# - premiere ligne, le code de retour pour nagios + 
-seconde ligne, le commentaire pour nagios+if [ 3 -ne $# ] ; then 
 +  echo "Wrong parameters."​ 
 +  echo "Usage : $0 web_site username password"​ 
 +  exit 
 +fi
  
 site=$1 site=$1
Ligne 37: Ligne 41:
 STATE_DEPENDENT=4 STATE_DEPENDENT=4
  
 +# Get status
 ret=$(wget -q -O - "​$url"​ --user="​$user"​ --password="​$pass"​) ret=$(wget -q -O - "​$url"​ --user="​$user"​ --password="​$pass"​)
  
 nbl=$(echo -e "​$ret"​|wc -l) nbl=$(echo -e "​$ret"​|wc -l)
  
 +# Check the content of the page
 if [ 2 -ne $nbl ] ; then if [ 2 -ne $nbl ] ; then
   echo "​Problem:​ there is $nbl line instead of 2"   echo "​Problem:​ there is $nbl line instead of 2"
Ligne 50: Ligne 56:
 comment=$(echo -e "​$ret"​ | tail -n 1) comment=$(echo -e "​$ret"​ | tail -n 1)
  
 +# Check informations of the Joomla! component
 if [[ ! "​$state"​ =~ [0-4] ]] ; then if [[ ! "​$state"​ =~ [0-4] ]] ; then
   echo "​Problem:​ -$state- should be a number between 0 and 4"   echo "​Problem:​ -$state- should be a number between 0 and 4"
Ligne 55: Ligne 62:
 fi fi
  
 +# Return informations
 echo $comment echo $comment
 exit $state exit $state
 </​code>​ </​code>​
  
-=== Configuration de Nagios ===+==== Configuration de Nagios ​====
  
 Tout d'​abord,​ définissons un templates pour vos services Joomla! : Tout d'​abord,​ définissons un templates pour vos services Joomla! :
start/developpement/joomla/nagioscheck4updates.1354894779.txt.gz · Dernière modification: 2012/12/07 16:39 par fufroma