3 # ============LICENSE_START================================================
5 # =========================================================================
6 # Copyright (C) 2022 Nordix Foundation.
7 # =========================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END==================================================
22 function health_check() {
25 health_report_temp_file=$(mktemp)
28 curl -s "https://logs.onap.org/onap-integration/daily/$health_dir"/ | \
32 sed -e 's/^.*href="//' \
36 report_last_health=$( \
37 curl -s "https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/" | \
41 sed -e 's/^.*href="//' \
45 curl -s --output "$health_report_temp_file" \
46 "https://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html"
47 health_check_result=$(
48 gunzip -c "$health_report_temp_file" | \
49 grep 'window.output\["stats"\]' | \
50 sed 's/},{/}\n{/g' | \
51 grep health-policy | \
56 awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}'
59 report_day="${report_last_health%%_*}"
60 report_hour_minute="${report_last_health#*_}"
61 report_hour_minute="${report_hour_minute/-/:}"
62 echo "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result"
69 health_check onap-daily-dt-oom-master
70 health_check onap-daily-dt-oom-jakarta
71 health_check onap-daily-dt-oom-istanbul
72 health_check onap_daily_pod4_master
74 jenkins_report_temp_file=$(mktemp)
76 curl -s https://jenkins.onap.org/view/policy/ | \
77 sed -e 's/<tr id=/\n<tr id=/g' \
78 -e 's/><td data=/\n><td data=/g' | \
82 -e 's/class= //' > "$jenkins_report_temp_file"
88 grep "job-status-red" "$jenkins_report_temp_file" | \
96 grep "job-status-yellow" "$jenkins_report_temp_file" | \
103 grep -v -E "(blue|red|yellow|verify|merge)" "$jenkins_report_temp_file" | \
109 curl -s https://jira.onap.org/issues/?jql=PROJECT%20%3D%20POLICY%20AND%20issuetype%20%3D%20Bug%20AND%20status%20!%3D%20Closed%20ORDER%20BY%20key%20ASC \ |
110 grep 'data-issue-table-model-state' | \
111 sed -e 's/"/\"/g' \
112 -e 's/.*";jiraHasIssues";:true,";page";:[0-9]*,";pageSize";:[0-9]*,";startIndex";:[0-9]*,";table";:\[//' \
113 -e 's/,";title";:";";,";total";:[0-9]*,";url";:";";,";sortBy";:\].*$//' \
116 sed -e 's/^.*key=/key=/g' \
119 -e 's/^.*key=/key=/g' \
120 -e 's/";:{";description=.*$//'