[How] ansible_stats_openeuler ${job_output}
./ansible_stats_openeuler /srv/result/ansible_test/2021-02-04/vm-2p16g--wcl/openeuler-20.03-aarch64/linux-system-roles-storage/crystal.974233/output
Signed-off-by: Wang Chenglong 18509160991@163.com --- stats/ansible_stats_openeuler | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 stats/ansible_stats_openeuler
diff --git a/stats/ansible_stats_openeuler b/stats/ansible_stats_openeuler new file mode 100755 index 000000000..5a6870eef --- /dev/null +++ b/stats/ansible_stats_openeuler @@ -0,0 +1,48 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true + +require 'json' + +job_error_msg = `grep -E 'FAILED! | failed: .*}$' #{ARGV[0]} | awk -F'=>' '{$1="";print $0}'` +error_msg_json = JSON.parse(job_error_msg) + +unless error_msg_json['msg'].nil? + puts "config.error.no-file-find-by.#{$1}: 1" if error_msg_json['msg'].match(/No file was found when using (.+)./) + + puts "yaml.error.syntax-problem.[#{$1}]: 1" if error_msg_json['msg'].match(/The error was: (.+)/) + + if error_msg_json['msg'].match(/No such file or directory/) + puts "command.error.no-such-command.#{error_msg_json['cmd']}: 1" + end + + if error_msg_json['msg'].match(/Failed to download metadata for repo '(.+)': /) + puts "download.error.failed-to-download.#{$1}: 1" + end + + puts "script.error [#{error_msg_json['cmd']}]: 1" if error_msg_json['msg'].match(/non-zero return code/) + + puts "download.error.http-error-404 [#{$1}]: 1" if error_msg_json['msg'].match(/Failure downloading (.+), /) + + if error_msg_json['msg'].match(/Could not find the requested service firewall: (.+)/) + puts "firewall.error.could-not-find-server.#{$1}: 1" + end + + puts "service.error.unable-to-star-service.#{$1}: 1" if error_msg_json['msg'].match(/Unable to start service (.+):/) + + puts 'system.error.not-supporte: 1' if error_msg_json['msg'].match(/is not supporte/) + + puts "depsolve.error.depend-package-error.#{$1}: 1" if error_msg_json['msg'].match(/needed by (.+)/) + + puts 'read.error.read-timed-out: 1' if error_msg_json['msg'].match(/failed to create temporary content file/) +end + +error_msg_json['failures']&.each do |items| + items.match(/No package (.+) available/) + puts "yum.error.no-package-match.#{$1}: 1" +end + +unless error_msg_json['message'].nil? + puts "yaml.error.not-find-yml.#{$1}: 1" if a['message'].to_s.match(/Could not find or access (.+)/) +end