5 airsearches_update_every=15
8 wget 2>/dev/null -O - "$airsearches_url" |\
9 sed -e "s|<br />|\n|g" -e "s|: |=|g" -e "s| \+|_|g" |\
10 tr "[A-Z]\.\!@#\$%^&*()_+\-" "[a-z]_____________" |\
11 egrep "^[a-z0-9_]+=[0-9]+$" |\
16 # check once if the url works
17 wget 2>/dev/null -O /dev/null "$airsearches_url"
20 echo >&2 "airsearches: cannot fetch the url: $airsearches_url. Please set airsearches_url='url' in $confd/airsearches.conf"
24 if [ -z "$airsearches_cmds" ]
26 airsearches_cmds="`airsearches_get | cut -d '=' -f 1`"
29 if [ -z "$airsearches_cmds" ]
31 echo >&2 "airsearches: cannot find command list automatically. Please set airsearches_cmds='...' in $confd/airsearches.conf"
37 airsearches_create() {
40 echo "CHART airsearches.affiliates '' 'Air Searches per affiliate' 'requests / min' airsearches '' stacked 20000 $airsearches_update_every"
41 for x in $airsearches_cmds
43 echo "DIMENSION $x '' incremental 60 $airsearches_update_every"
49 airsearches_update() {
50 # the first argument to this function is the microseconds since last update
51 # pass this parameter to the BEGIN statement (see bellow).
53 # do all the work to collect / calculate the values
55 # remember: KEEP IT SIMPLE AND SHORT
57 # get the values from airsearches
58 eval "`airsearches_get | sed "s/^/airsearches_/g"`"
60 # write the result of the work.
63 echo "BEGIN airsearches.affiliates $1"
64 for x in $airsearches_cmds
66 eval "v=\$airsearches_$x"