source: hybrid/branches/releng-9/nanobsd/files/usr/local/libexec/nagios/check_inet2

Last change on this file was 14358, checked in by rick, 6 years ago

Fix documentation files no longer installed

  • Property svn:executable set to *
File size: 652 bytes
Line 
1#!/bin/sh
2
3PATH=$PATH:/bin:/usr/bin
4export PATH
5
6# Test page to query
7PROXY_TEST=http://proxy-test.wirelessleiden.nl/
8
9# Query the webpage
10SPEEDOUT=`fetch -o /dev/null ${PROXY_TEST} 2>&1`
11
12# What is the Exit code of fetch?
13SPEEDEXIT=$?
14
15# The speed by which the webpages was retrieved"
16SPEED=`echo ${SPEEDOUT} | awk '/Bps/ { print $13 " " $14 }'`
17
18# Dit the fetcommand exit happy, and was the format as we expected
19if [ ${SPEEDEXIT} -eq 0 -a "$SPEED" ]; then
20
21 # Let's celebrate, it was successfull
22 printf "INET OK: $SPEED\n"
23 exit 0
24else
25
26 # Oh no, time to get drunk, retrieval was unsuccessfull
27 echo "INET CRITICAL: $SPEEDOUT\n"
28 exit 2
29
30fi
31
Note: See TracBrowser for help on using the repository browser.