2 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> lftools-sysstat.sh"
12 set +e # DON'T fail build if script fails.
14 OS=$(facter operatingsystem)
17 SYSSTAT_PATH="/var/log/sysstat"
20 SYSSTAT_PATH="/var/log/sa"
28 SAR_DIR="$WORKSPACE/archives/sar-reports"
30 cp "$SYSSTAT_PATH/"* $_
31 # convert sar data to ascii format
32 while IFS="" read -r s
34 [ -f "$s" ] && LC_TIME=POSIX sar -A -f "$s" > "$SAR_DIR/"sar${s//[!0-9]/}
35 done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)
37 # DON'T fail build if script fails.