From b336ea4298e51b31460b667e13362e397140aa0b Mon Sep 17 00:00:00 2001 From: Pascal Date: Wed, 3 Mar 2021 12:42:37 -0500 Subject: [PATCH] [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 --- files/inet_stat.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/files/inet_stat.sh b/files/inet_stat.sh index aad6535..6acbb89 100755 --- a/files/inet_stat.sh +++ b/files/inet_stat.sh @@ -82,13 +82,16 @@ function ping_server() satistic="$(echo "${ping_output[1]}" | cut -d' ' -f4 | sed -E 's/\//,/g')" # Name or service not known - if [ "${#packet_loss}" -eq 0 ]; then - packet_loss="-1" + if [ "${#packet_loss}" -eq 0 ]; then + # make this Error visually apparent in the plot + packet_loss="100%" + satistic="-100,-100,-100,-100" fi # 100% package loss - if [ "${#satistic}" -eq 0 ]; then - satistic="-1,-1,-1,-1" + if [ "${#satistic}" -eq 0 ]; then + # don't need to plot this data as package loss is displayed + satistic="NaN,NaN,NaN,NaN" fi echo "$(date $DATE_FORMAT),$server,$packet_loss,$satistic"