Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #4 #5

Merged
merged 3 commits into from
Nov 8, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions check_vpn/check_vpn
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ vpn_connectivity_check() {
source_based_routing $device up

# perform test
curl --interface $device --connect-timeout 10 --speed-time 5 -s -o /dev/null $test_url
curl
--interface $device \
--connect-timeout 10 \
--speed-time 5 \
-w "time=%{time_connect}s;size=%{size_download}B" \
-s -o /dev/null $test_url
local -i retval=$?

# remove routing
Expand Down Expand Up @@ -226,12 +231,14 @@ main() {
# start vpn
_${type}_start_vpn $lns $username $password $device "$@"
if [ $? -eq 0 ] && wait_for_vpn_to_come_up $type $lns $device; then
if vpn_connectivity_check $device $test_url; then
echo "OK: VPN to '$lns' up and running on '$device', '$test_url' reachable"
local tmp_perf_data=`mktemp`
if vpn_connectivity_check $device $test_url > $tmp_perf_data; then
echo "OK: VPN to '$lns' up and running on '$device', '$test_url' reachable|"`cat $tmp_perf_data`
else
echo "Warning: VPN ($type) up, connectivity check failed to '$test_url'"
echo "Warning: VPN ($type) up, connectivity check failed to '$test_url'|"`cat $tmp_perf_data`
retval=1
fi
rm -f $tmp_perf_data
else
echo "Critical: VPN ($type) connection failed to '$lns': '$ERROR_STRING'"
retval=2
Expand Down