Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set +x
- set -e
- echo ""
- echo "---------------------------------------------------------------------"
- echo "Generating Crash Report Dashboard"
- echo "---------------------------------------------------------------------"
- echo ""
- REPORT_SERVER=$(cat servers.list | xargs)
- SUMMARY=""
- # Check each subfolder for the logs
- for server in $REPORT_SERVER
- do
- echo ""
- echo "---------------------------------------------------------------------"
- echo "Checking subfolder contents for $server"
- echo "---------------------------------------------------------------------"
- echo ""
- for file in ./$server/*
- do
- # Only read .log files
- if [[ $file == *log ]]; then
- grep -hr -A2 --no-group-separator "Details:" ./$server/* | awk '!(NR%3)' > $server-summary.txt
- fi
- done
- echo "Parsed errors for $server"
- echo ""
- echo "---------------------------------------------------------------------"
- echo " Grouping related crash reports for $server"
- echo "---------------------------------------------------------------------"
- echo ""
- echo "All errors for $server"
- errors=$(sort $server-summary.txt | uniq -c | sort -bgr)
- echo "$errors"
- SUMMARY="{$SUMMARY\n{$server}\n{$errors}\n"
- done
- # Create a dashboard
- dashboard=$(cat <<EOF
- <html>
- <head>
- <meta charset="utf-8">
- <title>V-DOCS Crash Reports - Dashboard</title>
- <style>
- html {
- background: #6b6b6b;
- }
- body {
- font: 13px/1.4 Arial, sans-serif;
- width: 980px;
- background: #fff;
- padding: 20px;
- margin: 20px auto;
- border-radius: 5px;
- box-shadow: 1px 3px 5px #060606;
- }
- .sha {
- font-family: monospace;
- }
- .date {
- font-weight: normal;
- font-size: 11px;
- display: block;
- }
- </style>
- </head>
- <body>
- <h1>V-DOCS Crash Reports</h1>
- ${SUMMARY}
- </body>
- </html>
- EOF
- )
- # Output to a file
- echo "$dashboard" > dashboard.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement