Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #680 from jodh-intel/add-shim-to-data-collection-s…
Browse files Browse the repository at this point in the history
…cript

Add shim to data collection script
  • Loading branch information
Graham Whaley authored Oct 6, 2017
2 parents 529c51f + bfc2752 commit e415817
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions data/cc-collect-data.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ script_version="@VERSION@ (commit @COMMIT@)"
PROBLEM_LIMIT=${PROBLEM_LIMIT:-50}

problem_pattern="("
problem_pattern+="\<warn\>"
problem_pattern+="\<abort\>|"
problem_pattern+="\<cannot\>|"
problem_pattern+="\<critical\>|"
problem_pattern+="\<does.*not.*exist\>|"
problem_pattern+="\<error\>|"
problem_pattern+="\<fail\>|"
problem_pattern+="\<failure\>|"
problem_pattern+="\<failed\>|"
problem_pattern+="\<fatal\>|"
problem_pattern+="\<impossible\>|"
problem_pattern+="\<missing\>|"
problem_pattern+="\<no.*such.*file\>|"
problem_pattern+="\<not.*found\>|"
problem_pattern+="\<warn\>|"
problem_pattern+="\<warning\>"
problem_pattern+="|\<error\>"
problem_pattern+="|\<fail\>"
problem_pattern+="|\<failed\>"
problem_pattern+="|\<fatal\>"
problem_pattern+="|\<impossible\>"
problem_pattern+="|\<missing\>"
problem_pattern+="|\<does.*not.*exist\>"
problem_pattern+="|\<not.*found\>"
problem_pattern+="|\<no.*such.*file\>"
problem_pattern+="|\<cannot\>"
problem_pattern+=")"

usage()
Expand Down Expand Up @@ -161,6 +164,7 @@ show_log_details()

show_runtime_log_details
show_proxy_log_details
show_shim_log_details

separator
}
Expand Down Expand Up @@ -194,23 +198,40 @@ show_runtime_log_details()
fi
}

show_proxy_log_details()
find_system_journal_problems()
{
subheading "Proxy logs"
name="$1"
program="$2"

local problems=$(journalctl -q -o cat -lau "cc-proxy" |\
data_source="system journal"

local problems=$(journalctl -q -o cat -au "$program" |\
grep "time=" |\
egrep -i "$problem_pattern" |\
tail -n ${PROBLEM_LIMIT})

if [ -n "$problems" ]; then
msg "Recent proxy problems found in system journal:"
msg "Recent $name problems found in $data_source:"
show_quoted_text "$problems"
else
msg "No recent proxy problems found in system journal."
msg "No recent $name problems found in $data_source."
fi
}

show_proxy_log_details()
{
subheading "Proxy logs"

find_system_journal_problems "proxy" "cc-proxy"
}

show_shim_log_details()
{
subheading "Shim logs"

find_system_journal_problems "shim" "cc-shim"
}

show_package_versions()
{
heading "Packages"
Expand Down

0 comments on commit e415817

Please sign in to comment.