3 # ============LICENSE_START================================================
5 # =========================================================================
6 # Copyright (C) 2022-2023 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"
48 if file "$health_report_temp_file" | grep -q gzip
50 health_check_result=$(
51 gunzip -c "$health_report_temp_file" | \
52 grep 'window.output\["stats"\]' | \
53 sed 's/},{/}\n{/g' | \
54 grep health-policy | \
59 awk -F',' '{printf("%s,%s,%s\n", $3,$4,$2)}'
62 report_day="${report_last_health%%_*}"
63 report_hour_minute="${report_last_health#*_}"
64 report_hour_minute="${report_hour_minute/-/:}"
65 printf "$health_dir,$report_month-$report_day $report_hour_minute,$health_check_result\n"
66 printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n"
68 printf "$health_dir,$report_month-$report_day $report_hour_minute,result not available\n"
69 printf "\thttps://logs.onap.org/onap-integration/daily/$health_dir/$report_month/$report_last_health/xtesting-healthcheck/full/full/report.html\n"
77 health_check onap-daily-dt-oom-master
78 health_check onap-daily-dt-oom-kohn
79 health_check onap-daily-dt-oom-jakarta
80 health_check onap-daily-dt-oom-istanbul
82 jenkins_report_temp_file=$(mktemp)
84 curl -s https://jenkins.onap.org/view/policy/ |
85 sed -e 's/<tr id=/\n<tr id=/g' \
86 -e 's/><td data=/\n><td data=/g' |
91 grep '^job_' > "$jenkins_report_temp_file"
97 grep "job-status-red" "$jenkins_report_temp_file" |
99 grep -v release-merge |
102 awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
108 grep "job-status-yellow" "$jenkins_report_temp_file" |
112 awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
117 grep -v -E "(job-status-red|job-status-yellow|job-status-blue)" "$jenkins_report_temp_file" |
121 awk '{printf("https://jenkins.onap.org/%s\n", $1)}'
126 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 |
127 grep 'data-issue-table-model-state' |
128 sed -e 's/"/\"/g' \
129 -e 's/.*";jiraHasIssues";:true,";page";:[0-9]*,";pageSize";:[0-9]*,";startIndex";:[0-9]*,";table";:\[//' \
130 -e 's/,";title";:";";,";total";:[0-9]*,";url";:";";,";sortBy";:\].*$//' \
133 sed -e 's/^.*key=/key=/g' \
136 -e 's/^.*key=/key=/g' \
137 -e 's/";:{";description=.*$//' \
138 -e 's/key=POLICY-\([0-9]*\),/https:\/\/jira.onap.org\/browse\/POLICY-\1 /'