Outils pour utilisateurs

Outils du site


admin:services:date.chapril.org

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édentesRévision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
admin:chatons:date.chapril.org [2019/10/16 20:17] – [Préparation] dclermonteadmin:chatons:date.chapril.org [2020/02/05 14:24] – [Monitoring] dclermonte
Ligne 418: Ligne 418:
 </code> </code>
  
-Définir une entrée crontab :+Créer un fichier datechaprilorg et le placer dans /etc/cron.d :
 <code> <code>
-crontab -e -u datechaprilorg+45 23 * * * root /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&
 +41 11 * * * root /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&
 +1 0 1 * * root  /srv/date.chapril.org/tools/rapport_activite/rapport_activite.sh -p >> /srv/date.chapril.org/Exploitation/rapport_date.log 2>&
 +</code> 
 + 
 +====== Monitoring ====== 
 + 
 +Mettre dans le dossier /usr/lib/nagios/plugins un fichier check_datechaprilorg_update et une copie dans /srv/date.chapril.org/tools/monitoring : 
 + 
 +<code> 
 +#!/bin/bash 
 +function usage() { 
 + echo "Usage : $0" 
 +
 + 
 +
 +if [ "$#" -ne 0 ]; then 
 +    usage 
 +else 
 +    lastVersion=$(curl -s https://framagit.org/api/v4/projects/16/releases | jshon -a -e name|cut -d '"' -f2|grep -v '[\^\(alpha\)]'|head -n 1) 
 +    currentVersion=$(cd /var/www/date.chapril.org && git branch | grep '*'|cut -c 11-100 ) 
 + 
 +    #echo $currentVersion 
 +    #echo $lastVersion 
 +    if [ $currentVersion = $lastVersion ]; then 
 + echo "OK" 
 + result=0 
 +    else 
 + echo "WARNING : new version available, current is $currentVersion, last is $lastVersion." 
 + result=1 
 +    fi     
 +fi 
 +exit $result
  
-45 23 * * * /usr/bin/php /var/www/date.chapril.org/admin/cron_purge.php >> /srv/date.chapril.org/cron_purge.log 2>&1 
 </code> </code>
 +
 +Le fichier est commité dans ''/srv/date.chapril.org/tools/monitoring''.
admin/services/date.chapril.org.txt · Dernière modification : 2023/02/25 11:30 de obitanz