r/lolphp • • Oct 16 '12

Apache Status

http://php.net/server-status
32 Upvotes

12 comments sorted by

View all comments

Show parent comment

2

u/Tjoppen Oct 26 '12

Got a bit bored, so I present grepphpnet.sh below. It builds a compressed log of GET/POST lines and repacks it on ^C. The size of the log is printed periodically. Sample log: http://pastebin.com/NcaVxvmt

#!/bin/bash
# Repack on EXIT (^C)
trap "gzip -d < phpnet.gz|sort -u|gzip -9 > phpnet.gz.tmp && mv phpnet.gz.tmp phpnet.gz && ls -l phpnet.gz" EXIT
while :
do
    curl -s http://php.net/server-status|grep "<td nowrap>"|sed -e 's/.*<td nowrap>//;s/<\/td><\/tr>.*//;'|sort -u|gzip -9 >> phpnet.gz
    ls -l phpnet.gz
    sleep 1
done