Ignore:
Timestamp:
03/03/16 16:35:48 (8 years ago)
Author:
sdipsl
Message:
  • send relevant information to track project accounting history. See #270.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1282 r1285  
    219219    done 
    220220    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_Metrics " 
     221    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${attachmentsOptions} ${mail_recipient} 
     222  fi 
     223 
     224  # Allways all good for now. 
     225  return 0 
     226} 
     227 
     228#D-#================================================================== 
     229#D-function IGCM_debug_sendAMQP_projectAccounting 
     230#D- * Purpose: Take over AMQP C client using mail as a message recipient 
     231#D- * One argument : - File name where project accounting details are stored 
     232#D- * Attach encoded accounting file. 
     233 
     234function IGCM_debug_sendAMQP_projectAccounting { 
     235 
     236  typeset mail_recipient encodedBody 
     237  if [ X${ActivateBigBro} = Xtrue ] ; then 
     238    mail_recipient="superviseur@ipsl.jussieu.fr" 
     239    # Metrics tag on server side 
     240    code=7010 
     241    # Usual AMQP message to route messages on server side 
     242    encodedBody=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"accountingProject\":\"${PROJECT}\",\"centre\":\"${CENTER}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" |  base64 -w 0 ) 
     243    # send mail 
     244    attachmentsOptions="-a ${1}" 
     245    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_projectAccounting" 
    221246    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${attachmentsOptions} ${mail_recipient} 
    222247  fi 
     
    664689      IGCM_debug_sendAMQP 
    665690    fi 
     691 
     692    # Save project accounting details in a file 
     693    IGCM_sys_projectAccounting cpt_${CENTER}_${PROJECT}_$( date +"%Y%m%d_%H%M" ).dat 
     694 
     695    # And send it 
     696    IGCM_debug_sendAMQP_projectAccounting cpt_${CENTER}_${PROJECT}_$( date +"%Y%m%d_%H%M" ).dat 
     697 
    666698    # Turn the flag on 
    667699    ActivateBigBro=true 
Note: See TracChangeset for help on using the changeset viewer.