Chilli query

Setup the secret values on path: http://my-drupal-installation/admin/config/pgn-coova

Commit the same values to the CoovaAP-Firmeware.

nvram set pgn_secret_path="<>"
nvram set pgn_secret_identifier"<>"
nvram set pgn_url"<>"
nvram commit

Put file to path:

/usr/lib/chilli-query-curl.sh

Make file chilli-query-curl.sh excutable:

chmod +x /usr/lib/chilli-query-curl.sh

Setup an cron job, which runs the script in a certain interval: crontab -e

*/3 * * * * /usr/lib/chilli-query-curl.sh

/usr/lib/chilli-query-curl.sh

#! /bin/ash
# Output form chilli_query, e. g.:
# 1C-AB-A7-C4-6E-66 10.1.0.25 dnat 5071cecb00000003 0 - 0/0 0/0 0/0 0/0 0 0
0/0 0/0 http://www.apple.com/library/test/success.html
# 04-46-65-83-4E-A9 10.1.0.26 pass 5071ca6700000001 1 fh 1511/0 250/0
1966092/0 28965513/0 0 0 0%/0 0%/0 http://clients3.google.com/generate_204
WAN_HOSTNAME=$(nvram get wan_hostname)
PGN_SECRET_IDENTIFIER=$(nvram get pgn_secret_identifier)
URL="http://$(nvram get pgn_url)/$(nvram get pgn_secret_path)"
chilli_query list | grep '^[0-9A-F]' | awk '
{
dur = $7
sub ("/0", "", dur)
idl = $8
sub ("/0", "", idl)
ioc = $9
sub ("/0", "", ioc)
ooc = $10
sub ("/0", "", ooc)
query = "sec=" "'"$PGN_SECRET_IDENTIFIER"'" "&rou;=" "'"$WAN_HOSTNAME"'"
"&mac;=" $1 "&ipa;=" $2 "&sta;=" $3 "&sid;=" $4 "&aut;="
$5 "&usr;=" $6 "&dur;=" dur "&idl;=" idl "&ioc;=" ioc
"&ooc;=" ooc
print "'"$URL"'" "?" query
system("curl -G -d \"" query "\" " "'"$URL"'")
}
'
MAC Address
IP Address
internal chilli state (dnat, pass, etc)
the session id (used in Acct-Session-ID)
authenticated status (1 authorized, 0 not)
user-name used during login
duration / max duration
idle time / max idle time
input octets / max input octets
output octets / max output octets
max total octets
status of option
swapoctets
bandwidth limitation information
the original URL
04-46-65-83-4E-A9
10.1.0.3
dnat
506de08900000002
0
-
0/0
0/0
0/0
0/0
0
0
0/0
0/0
http://clients3.google.com/generate_204
1C-AB-A7-C4-6E-66
10.1.0.2
pass
506ddc1d00000001
1
fh
1125/0
48/0
2764624/0
353008/0
0
0
0%/0
0%/0
http://www.apple.com/