Skip to content

Instantly share code, notes, and snippets.

@acceptableEngineering
Created June 24, 2022 23:08
Show Gist options
  • Save acceptableEngineering/6ed8cb50ce791dcc72460ee08f00e690 to your computer and use it in GitHub Desktop.
Save acceptableEngineering/6ed8cb50ce791dcc72460ee08f00e690 to your computer and use it in GitHub Desktop.
#!/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