From a92115a365bfc4576080ed322b8cb39797740e22 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 8 Nov 2013 20:08:05 +1100 Subject: [PATCH 1/3] check_vpn: added performance data, with a few stub values --- check_vpn/check_vpn | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/check_vpn/check_vpn b/check_vpn/check_vpn index 12640ea..d3767f9 100755 --- a/check_vpn/check_vpn +++ b/check_vpn/check_vpn @@ -163,7 +163,11 @@ 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;;;0.000000 size=%{size_download}B;;;0" \ + -s -o /dev/null $test_url local -i retval=$? # remove routing @@ -226,12 +230,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 From db6e86461b2bbcd65b9d8d3fadfef9810ba26536 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 8 Nov 2013 20:13:40 +1100 Subject: [PATCH 2/3] check_vpn: fixed performance counters --- check_vpn/check_vpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_vpn/check_vpn b/check_vpn/check_vpn index d3767f9..e6e5d95 100755 --- a/check_vpn/check_vpn +++ b/check_vpn/check_vpn @@ -166,7 +166,7 @@ vpn_connectivity_check() { curl --interface $device \ --connect-timeout 10 \ --speed-time 5 \ - -w "time=%{time_connect}s;;;0.000000 size=%{size_download}B;;;0" \ + -w "time=%{time_connect}s;size=%{size_download}B" \ -s -o /dev/null $test_url local -i retval=$? From 2800fceb36b50a90528a2edefbcdfa244b893d49 Mon Sep 17 00:00:00 2001 From: Dan Fruehauf Date: Fri, 8 Nov 2013 20:15:43 +1100 Subject: [PATCH 3/3] check_vpn: indentation fix --- check_vpn/check_vpn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_vpn/check_vpn b/check_vpn/check_vpn index e6e5d95..54572b8 100755 --- a/check_vpn/check_vpn +++ b/check_vpn/check_vpn @@ -163,7 +163,8 @@ vpn_connectivity_check() { source_based_routing $device up # perform test - curl --interface $device \ + curl + --interface $device \ --connect-timeout 10 \ --speed-time 5 \ -w "time=%{time_connect}s;size=%{size_download}B" \