Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 345a3f79 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Zabbix error format

parent 0d1aedb8
...@@ -59,7 +59,7 @@ irods_push(){ ...@@ -59,7 +59,7 @@ irods_push(){
if [[ $s -ne 0 ]]; then if [[ $s -ne 0 ]]; then
echo "[$KEY] Error 002 creating remote directory." echo "[$KEY] Error 002 creating remote directory."
format_report $KEY $SIZEMB $(date +%Y-%m-%dT%H:%M:%S) - - 'Error 010. imkdir failed' >> $LOCAL_REPORT format_report $KEY $SIZEMB $(date +%Y-%m-%dT%H:%M:%S) - - 'Error 010. imkdir failed' >> $LOCAL_REPORT
zabbix_err "${KEY}:Error 002" zabbix_err "${KEY} Error 002"
return 1 return 1
fi fi
...@@ -72,23 +72,23 @@ irods_push(){ ...@@ -72,23 +72,23 @@ irods_push(){
irods_rollback $KEY irods_rollback $KEY
rm $RESIFDD_WORKDIR/${KEY}.tar rm $RESIFDD_WORKDIR/${KEY}.tar
# Alert to zabbix # Alert to zabbix
zabbix_err "${KEY}:Error 011" zabbix_err "${KEY} Error 011"
else else
duration=$(($(date +%s)-$start)) duration=$(($(date +%s)-$start))
throughput=$(($SIZEMB / $duration )) throughput=$(($SIZEMB / $duration ))
# Compute remote checksum # Compute remote checksum
echo "[$KEY] staging.tar data sent, let's compute remote checksum" echo "[$KEY] staging.tar data sent, let's compute remote checksum"
irods_sha=$(ichksum $KEY/staging.tar | awk -F':' '/sha2:/ {print $2; exit;}') irods_sha=$(ichksum $KEY/staging.tar | awk -F':' '/sha2:/ {print $2; exit;}')
echo "[$KEY] $irods_sha" echo "[$KEY] $irods_sha"
if [[ "$SHA" = "$irods_sha" ]]; then if [[ "$SHA" = "$irods_sha" ]]; then
echo "[$KEY] checksums match, commit remote data" echo "[$KEY] checksums match, commit remote data"
format_report $KEY $SIZEMB $(date +%Y-%m-%dT%H:%M:%S --date=@$start) $duration $throughput 'OK' >> $LOCAL_REPORT format_report $KEY $SIZEMB $(date +%Y-%m-%dT%H:%M:%S --date=@$start) $duration $throughput 'OK' >> $LOCAL_REPORT
irods_commit $KEY irods_commit $KEY
zabbix_ok "$KEY|${SIZEMB}MB|${duration}s|${throughput}MB/s" zabbix_ok "$KEY|${SIZEMB}MB|${duration}s|${throughput}MB/s"
else else
echo "[$KEY] Error 012, checksum mismatch" echo "[$KEY] Error 012, checksum mismatch"
zabbix_err "${KEY} Error 012" zabbix_err "${KEY} Error 012"
fi fi
rm $RESIFDD_WORKDIR/${KEY}.* rm $RESIFDD_WORKDIR/${KEY}.*
fi fi
# Send report to irods. Do some locking here # Send report to irods. Do some locking here
...@@ -194,7 +194,7 @@ pack_and_send() { ...@@ -194,7 +194,7 @@ pack_and_send() {
echo "[$KEY] Error 007 creating tar" echo "[$KEY] Error 007 creating tar"
rm -f $RESIFDD_WORKDIR/$KEY.tar rm -f $RESIFDD_WORKDIR/$KEY.tar
# Send key to zabbix_err # Send key to zabbix_err
zabbix_err "$KEY:Error 007" zabbix_err "$KEY Error 007"
return 1 return 1
fi fi
local_sha=$(sha256sum $RESIFDD_WORKDIR/$KEY.tar | awk '{print $1}' | xxd -r -p | base64) local_sha=$(sha256sum $RESIFDD_WORKDIR/$KEY.tar | awk '{print $1}' | xxd -r -p | base64)
...@@ -302,7 +302,7 @@ if [[ "x$DUMP_METADATA" = "xyes" ]]; then ...@@ -302,7 +302,7 @@ if [[ "x$DUMP_METADATA" = "xyes" ]]; then
tar cf $RESIFDD_WORKDIR/$KEY.tar --exclude portalproducts -C $SNAPSHOT_DIR . tar cf $RESIFDD_WORKDIR/$KEY.tar --exclude portalproducts -C $SNAPSHOT_DIR .
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
echo "[$KEY] Error 001 while creating tar archive." echo "[$KEY] Error 001 while creating tar archive."
zabbix_err "${KEY}:Error 001" zabbix_err "${KEY} Error 001"
exit 1 exit 1
fi fi
local_sha=$(sha256sum $RESIFDD_WORKDIR/$KEY.tar | awk '{print $1}' | xxd -r -p | base64) local_sha=$(sha256sum $RESIFDD_WORKDIR/$KEY.tar | awk '{print $1}' | xxd -r -p | base64)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment