Last active
January 21, 2021 09:46
-
-
Save Decstasy/98c0f9b5bf987b88afe630972f91fb84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $# -ne 1 ]]; then | |
echo "$0 [path to sysstat file made with: \"LANG=POSIX LC_ALL=C sar -Adp\"]" | |
exit 1 | |
fi | |
_FILE = "$1" | |
# Der Parser von ksar mag bestimmte sachen nicht und beendet sich dann mit einer exception | |
# Daher werden hier, sofern grep etwas findet, mit perl einige Blöcke aus dem Report entfernt. | |
if grep -qs 'kbhugfree\|irec/s\|ihdrerr/s\|imsg/s\|ierr/s\|active/s\|degC\|idvendor' $_FILE; then | |
PTMP=$(mktemp) | |
perl -n -e 'print unless /^[\d:]{8}\s+(kbhugfree|irec\/s|ihdrerr\/s|imsg\/s|ierr\/s|active\/s|TEMP|BUS)/../^$/' $_FILE > $PTMP | |
mv $PTMP $_FILE | |
fi | |
# java -jar /opt/ksar/kSar.jar -cpuFixedAxis -noEmptyDisk -input $_FILE -outputPDF /tmp/report.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment