Skip to content
Snippets Groups Projects
Commit ea98a33a authored by Josef Němec's avatar Josef Němec
Browse files

Update cephpingmon.sh

parent ffba9a96
No related branches found
No related tags found
1 merge request!12Finalize cephpingmon
Pipeline #416593 passed
......@@ -18,7 +18,7 @@ function publish_metrics_nofrag {
ping_result=$(ping -q -c4 -W 1 -s $MTU_SIZE -M do $ip)
loss_percent=$(echo ${ping_result} | sed -n -e 's/^.*, \(.*\)% packet.*/\1/p')
success_ratio=$(echo "scale=2 ; 1 - ${loss_percent} / 100" | bc)
LC_NUMERIC=C printf '%s{ip="%s", fragmentation="%s"} %.2f\n' \
LC_NUMERIC=C printf '%s{endpoint_ip="%s", fragmentation="%s"} %.2f\n' \
"${METRIC_NAME}" $ip $fragmentation "${success_ratio}"
done
}
......@@ -33,7 +33,7 @@ function publish_metrics_frag {
ip=$(echo $line | cut -d' ' -f1)
loss_percent=$(echo $line | cut -d' ' -f5 | cut -d'/' -f3 | tr -d % | tr -d ,)
success_ratio=$(echo "scale=2 ; 1 - ${loss_percent} / 100" | bc)
LC_NUMERIC=C printf '%s{ip="%s", fragmentation="%s"} %.2f\n' \
LC_NUMERIC=C printf '%s{endpoint_ip="%s", fragmentation="%s"} %.2f\n' \
"${METRIC_NAME}" $ip $fragmentation "${success_ratio}"
done <<< "$1"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment