Commit 54f11263 authored by Larkin Heintzman's avatar Larkin Heintzman

updates to ping script

parent 0fe0fa2e
#!/bin/bash #!/bin/bash
endpoints="192.168.111.200" endpoints="192.168.111.200"
filename="/home/llh/pingStats/pingStats.json" filename="/home/larkin/pingStats/pingStats.json"
downtime=1 downtime=5
gpstopic="/rossettiModem/dji_sdk/gps_position" gpstopic="/marioModem/dji_sdk/gps_position"
echo "pinging: $endpoints" echo "pinging: $endpoints"
echo "save to: $filename" echo "save to: $filename"
...@@ -22,7 +22,7 @@ echo ping "${endpoints} every ${downtime:=1} sec, saving to ${filename}" ...@@ -22,7 +22,7 @@ echo ping "${endpoints} every ${downtime:=1} sec, saving to ${filename}"
# done # done
while true; do while true; do
rawData=$(ping -c 3 -q -w 3 ${endpoints:=localhost}) rawData=$(ping -c 5 -q -w 5 ${endpoints:=localhost})
newPacketData=$(echo "$rawData" | grep -oP '\d+(?=% packet loss)') newPacketData=$(echo "$rawData" | grep -oP '\d+(?=% packet loss)')
newLatencyData=$(echo "$rawData" | tail -n 1) newLatencyData=$(echo "$rawData" | tail -n 1)
...@@ -42,20 +42,6 @@ while true; do ...@@ -42,20 +42,6 @@ while true; do
num4="0" num4="0"
fi fi
# debugging help
# echo "------------------"
# echo $num1
# echo $num2
# echo $num3
# echo $num4
# echo "------------------"
# echo "$rawData"
# echo "------------------"
# echo "$newPacketData"
# echo "------------------"
# echo "$newLatencyData"
# exit
if test -f "$filename"; then if test -f "$filename"; then
false false
else else
......
#!/bin/bash #!/bin/bash
docker run --env endpoints=192.168.111.200 --env filename=/tmp/pingStats/pingStatsDocker.json --env gpstopic=/rossettiModem/dji_sdk/gps_position --env downtime=1 --env ROS_IP=192.168.111.202 --env ROS_MASTER_URI=http://192.168.111.200:11311 -v /home/larkin/pingStats:/tmp/pingStats/ doorbell:latest /ping.sh docker run --env endpoints=192.168.111.200 --env filename=/tmp/pingStats/pingStatsDocker.json --env gpstopic=/marioModem/dji_sdk/gps_position --env downtime=5 --env ROS_IP=192.168.111.202 --env ROS_MASTER_URI=http://192.168.111.200:11311 -v /home/larkin/pingStats:/tmp/pingStats/ localhost:5000/doorbell:latest /ping.sh
...@@ -26,7 +26,7 @@ echo ping "${endpoints} every ${downtime:=1} sec, saving to ${filename}" ...@@ -26,7 +26,7 @@ echo ping "${endpoints} every ${downtime:=1} sec, saving to ${filename}"
# done # done
while true; do while true; do
rawData=$(ping -c 3 -q -w 3 ${endpoints:=localhost}) rawData=$(ping -c 5 -q -w 5 ${endpoints:=localhost})
newPacketData=$(echo "$rawData" | grep -oP '\d+(?=% packet loss)') newPacketData=$(echo "$rawData" | grep -oP '\d+(?=% packet loss)')
newLatencyData=$(echo "$rawData" | tail -n 1) newLatencyData=$(echo "$rawData" | tail -n 1)
...@@ -46,20 +46,6 @@ while true; do ...@@ -46,20 +46,6 @@ while true; do
num4="0" num4="0"
fi fi
# debugging help
# echo "------------------"
# echo $num1
# echo $num2
# echo $num3
# echo $num4
# echo "------------------"
# echo "$rawData"
# echo "------------------"
# echo "$newPacketData"
# echo "------------------"
# echo "$newLatencyData"
# exit
if test -f "$filename"; then if test -f "$filename"; then
false false
else else
......
...@@ -47,14 +47,12 @@ spec: ...@@ -47,14 +47,12 @@ spec:
env: env:
- name: endpoints - name: endpoints
value: "192.168.111.200" value: "192.168.111.200"
- name: interface
value: "eth0" # not strictly necessary
- name: filename - name: filename
value: "/tmp/pingStats/pingStatsKubernetes.json" value: "/tmp/pingStats/pingStatsKubernetes.json"
- name: downtime # time to wait between pings - name: downtime # time to wait between pings
value: "1" value: "5"
- name: gpstopic - name: gpstopic
value: "/rossettiModem/dji_sdk/gps_position" value: "/marioModem/dji_sdk/gps_position"
- name: ROS_IP - name: ROS_IP
value: "192.168.111.202" value: "192.168.111.202"
- name: ROS_MASTER_URI - name: ROS_MASTER_URI
...@@ -63,6 +61,6 @@ spec: ...@@ -63,6 +61,6 @@ spec:
- containerPort: 11311 - containerPort: 11311
name: pingport name: pingport
nodeSelector: nodeSelector:
kubernetes.io/hostname: rossetti kubernetes.io/hostname: mario
# kubernetes.io/hostname: neruda # kubernetes.io/hostname: neruda
# kubernetes.io/hostname: sentinel # kubernetes.io/hostname: sentinel
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment