X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=integration%2Fsrc%2Fmain%2Fscripts%2Freports%2Fpf_status_report.sh;h=539232ab474d8977cddb9b9ce3007dfe33414749;hb=555565323a6095abcbe1a761faac2d71a455dfe0;hp=c979066c581ef62b4b6ce20880ffc654a444d36e;hpb=12fea027b14c36fe3b8e16f5a2aeedab8366285c;p=policy%2Fparent.git diff --git a/integration/src/main/scripts/reports/pf_status_report.sh b/integration/src/main/scripts/reports/pf_status_report.sh index c979066c..539232ab 100755 --- a/integration/src/main/scripts/reports/pf_status_report.sh +++ b/integration/src/main/scripts/reports/pf_status_report.sh @@ -44,22 +44,30 @@ function health_check() { curl -s --output "$health_report_temp_file" \ "https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html" - health_check_result=$( - gunzip -c "$health_report_temp_file" | \ - grep 'window.output\["stats"\]' | \ - sed 's/},{/}\n{/g' | \ - grep health-policy | \ - sed -e 's/{//g' \ - -e 's/}//g' \ - -e 's/"//g' \ - -e 's/label://' | \ - awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}' - ) - report_day="${report_last_health%%_*}" - report_hour_minute="${report_last_health#*_}" - report_hour_minute="${report_hour_minute/-/:}" - echo "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result" + if file "$health_report_temp_file" | grep -q gzip + then + health_check_result=$( + gunzip -c "$health_report_temp_file" | \ + grep 'window.output\["stats"\]' | \ + sed 's/},{/}\n{/g' | \ + grep health-policy | \ + sed -e 's/{//g' \ + -e 's/}//g' \ + -e 's/"//g' \ + -e 's/label://' | \ + awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}' + ) + + report_day="${report_last_health%%_*}" + report_hour_minute="${report_last_health#*_}" + report_hour_minute="${report_hour_minute/-/:}" + printf "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result\n" + printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n" + else + printf "$health_dir,$report_month-$report_day $report_hour_minute,result not available\n" + printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n" + fi } echo "" @@ -73,48 +81,57 @@ health_check onap_daily_pod4_master jenkins_report_temp_file=$(mktemp) -curl -s https://jenkins.onap.org/view/policy/ | \ +curl -s https://jenkins.onap.org/view/policy/ | sed -e 's/