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

updates to ping script

parent 0fe0fa2e
#!/bin/bash
endpoints="192.168.111.200"
filename="/home/llh/pingStats/pingStats.json"
downtime=1
gpstopic="/rossettiModem/dji_sdk/gps_position"
filename="/home/larkin/pingStats/pingStats.json"
downtime=5
gpstopic="/marioModem/dji_sdk/gps_position"
echo "pinging: $endpoints"
echo "save to: $filename"
......@@ -22,7 +22,7 @@ echo ping "${endpoints} every ${downtime:=1} sec, saving to ${filename}"
# done
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)')
newLatencyData=$(echo "$rawData" | tail -n 1)
......@@ -42,20 +42,6 @@ while true; do
num4="0"
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
false
else
......
#!/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}"
# done
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)')
newLatencyData=$(echo "$rawData" | tail -n 1)
......@@ -46,20 +46,6 @@ while true; do
num4="0"
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
false
else
......
......@@ -47,14 +47,12 @@ spec:
env:
- name: endpoints
value: "192.168.111.200"
- name: interface
value: "eth0" # not strictly necessary
- name: filename
value: "/tmp/pingStats/pingStatsKubernetes.json"
- name: downtime # time to wait between pings
value: "1"
value: "5"
- name: gpstopic
value: "/rossettiModem/dji_sdk/gps_position"
value: "/marioModem/dji_sdk/gps_position"
- name: ROS_IP
value: "192.168.111.202"
- name: ROS_MASTER_URI
......@@ -63,6 +61,6 @@ spec:
- containerPort: 11311
name: pingport
nodeSelector:
kubernetes.io/hostname: rossetti
kubernetes.io/hostname: mario
# kubernetes.io/hostname: neruda
# 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