sysstat_webhook : remove oneday as a default parameter for sadf

This commit is contained in:
minoplhy 2023-11-02 12:01:47 +07:00
parent 08c7604a27
commit 7f3da3aa98
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF

View File

@ -9,6 +9,7 @@ do
d) DISK_IO="True";; # DISK I/O d) DISK_IO="True";; # DISK I/O
n) NETWORK="True";; # Network n) NETWORK="True";; # Network
f) datafile=${OPTARG};; # where your data belongs! f) datafile=${OPTARG};; # where your data belongs!
o) SYSSTAT_OPTIONS=${OPTARG};; # Sysstat options
esac esac
done done
@ -35,7 +36,7 @@ function graph_gen {
POSTSVG=$MAKE_DIR/sysstat_"$2"_data.svg POSTSVG=$MAKE_DIR/sysstat_"$2"_data.svg
POSTPNG=$MAKE_DIR/sysstat_"$2"_data.png POSTPNG=$MAKE_DIR/sysstat_"$2"_data.png
/usr/bin/sadf -g $EXPANSION -O oneday,skipempty -- $1 > $POSTSVG /usr/bin/sadf -g ${EXPANSION[@]} -O skipempty,packed -- $1 > $POSTSVG
svg_to_png $POSTSVG $POSTPNG svg_to_png $POSTSVG $POSTPNG
Process $POSTPNG Process $POSTPNG
} }
@ -60,8 +61,13 @@ if [ ! -n "${webhook_url}" ]; then
exit 1 exit 1
fi fi
EXPANSION = ()
if [ ! "$SYSSTAT_OPTIONS" == "" ]; then
EXPANSION+=$SYSSTAT_OPTIONS
fi
if [ -f "$datafile" ]; then if [ -f "$datafile" ]; then
EXPANSION="-f $datafile" EXPANSION+="-f $datafile"
fi fi
if [ "$CPU" == "True" ]; then if [ "$CPU" == "True" ]; then