" >> $html
echo '' >> $html
echo "" >> $html
echo "$reportDate" >> $html
echo " | " >> $html
echo "
" >> $html
echo '' >> $html
echo "" >> $html
echo "Start time" >> $html
echo " | " >> $html
echo "$SessionStartTimeB | " >> $html
echo "" >> $html
echo "" >> $html
echo " | " >> $html
echo "
" >> $html
echo "" >> $html
echo "" >> $html
echo "End time" >> $html
echo " | " >> $html
echo "$SessionStopTimeB | " >> $html
echo "
" >> $html
echo "" >> $html
echo "" >> $html
echo "Duration" >> $html
echo " | " >> $html
echo "$SessionDurationB | " >> $html
echo "
" >> $html
echo "" >> $html
echo "" >> $html
echo "Details" >> $html
echo " | " >> $html
echo "
" >> $html
echo '" >> $html
declare -i arraysessionslogbackup=0
for row in $(echo "$veeamVBASessionsLogBackupUrl" | jq -r '.log[].logTime'); do
SessionLogStatus=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].status")
case $SessionLogStatus in
Success)
bcolor="#54B948"
;;
Warning)
bcolor="#F2C973"
;;
Failed)
bcolor="#E8595A"
;;
Error)
bcolor="#E8595A"
;;
esac
case $SessionExtendedType in
PolicyBackup)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred=$(echo $SessionLogMessage | awk -F %, '{print $2}')
SessionLogWorkloadType="EC2 Backup"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS -$SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "$SessionLogWorkloadName | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
PolicySnapshot)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="EC2 Snapshot"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "$SessionLogWorkloadName | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
PolicyRemoteSnapshot)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="EC2 Replica Snapshot"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "$SessionLogWorkloadName | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
VpcBackup)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Performing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $5" "$6" "$7" - AWS Account "$12}')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="VPC Backup"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "$SessionLogWorkloadName | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
PolicyRdsSnapshot)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="RDS Snapshot"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "$SessionLogWorkloadName | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
PolicyEfsBackup)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="EFS Backup"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS -$SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "EFS Workloads | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
PolicyEfsBackupCopy)
SessionLogMessage=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].message")
case $SessionLogMessage in
Processing*)
SessionLogWorkloadName=$(echo $SessionLogMessage |awk '{print $2}' | sed 's/.$//')
SessionLogWorkloadTransferred="N/A"
SessionLogWorkloadType="EFS Backup Copy"
SessionLogStartTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStoptTime=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].logTime")
SessionLogDurationS=$(echo $(( $(date -d "$SessionLogStoptTime" "+%s") - $(date -d "$SessionLogStartTime" "+%s") )))
SessionLogDurationB=$(echo $(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))/3600))h:$(($(($SessionLogDurationS -$SessionLogDurationS/86400*86400))%3600/60))m:$(($(($SessionLogDurationS - $SessionLogDurationS/86400*86400))%60))s)
SessionLogStart=$(echo "$veeamVBASessionsLogBackupUrl" | jq --raw-output ".log[$arraysessionslogbackup].executionStartTime")
SessionLogStartB=$(date -d $SessionLogStart '+%r')
echo '' >> $html
echo "EFS Workloads | " >> $html
echo "$SessionLogWorkloadType | " >> $html
echo "" >> $html
echo "$SessionLogStatus" >> $html
echo " | " >> $html
echo "$SessionLogStartB | " >> $html
echo "$SessionLogWorkloadTransferred | " >> $html
echo "$SessionLogDurationB | " >> $html
echo "
" >> $html
;;
esac
;;
esac
arraysessionslogbackup=$arraysessionslogbackup+1
done
echo "" >> $html
echo "