[mod] changed data representation of 100% packet loss and service not known

- no need to display ping for 100% loss
 - use ping=-100 to show service not known error
 - -1 to hard to differentiate from low pings if limit is > 200
This commit is contained in:
2021-03-03 12:42:37 -05:00
parent 15986f7468
commit b336ea4298

View File

@@ -82,13 +82,16 @@ function ping_server()
satistic="$(echo "${ping_output[1]}" | cut -d' ' -f4 | sed -E 's/\//,/g')" satistic="$(echo "${ping_output[1]}" | cut -d' ' -f4 | sed -E 's/\//,/g')"
# Name or service not known # Name or service not known
if [ "${#packet_loss}" -eq 0 ]; then if [ "${#packet_loss}" -eq 0 ]; then
packet_loss="-1" # make this Error visually apparent in the plot
packet_loss="100%"
satistic="-100,-100,-100,-100"
fi fi
# 100% package loss # 100% package loss
if [ "${#satistic}" -eq 0 ]; then if [ "${#satistic}" -eq 0 ]; then
satistic="-1,-1,-1,-1" # don't need to plot this data as package loss is displayed
satistic="NaN,NaN,NaN,NaN"
fi fi
echo "$(date $DATE_FORMAT),$server,$packet_loss,$satistic" echo "$(date $DATE_FORMAT),$server,$packet_loss,$satistic"