Created
June 24, 2022 23:08
-
-
Save acceptableEngineering/6ed8cb50ce791dcc72460ee08f00e690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RESULT=$(/sbin/ping -s 1 -i 0.2 -c 20 8.8.8.8 | grep "packet loss" | /usr/bin/awk -F ',' '{print $3}' | awk '{print $1}' | /usr/bin/sed 's/%//') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name Outgoing-Ping-Loss --value ${RESULT} --region us-west-2 | |
RESULT=$(/sbin/ping -s 1 -i 0.2 -c 20 10.10.0.1 | grep "packet loss" | /usr/bin/awk -F ',' '{print $3}' | awk '{print $1}' | /usr/bin/sed 's/%//') | |
/usr/local/bin/aws cloudwatch put-metric-data --namespace "The Eyeris" --metric-name Internal-Ping-Loss --value ${RESULT} --region us-west-2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment