Give this a try.
It reads from /proc/net/tcp and reformats to decimal numbers.
If you run it without any args, it prints the current status and exits.
The way it's intended to be run is by specifying the name of a fifo as its only arg. Before you run it, do this:
mkfifo /tmp/netstat
(or wherever you want)
then run: hex2dec /tmp/netstat
it will sit waiting for someone to read from /tmp/netstat. When you do, it will convert the current contents of /proc/net/tcp and display them, then it goes back to waiting for another read request. This way, you just background the prog and then you can browse to your empeg at:
http://empeg/tmp/netstat and hit refresh in your browser to get an update.
Everytime I click refresh, I see another connection get used... seems a bit odd, I'm not sure what's wrong. So if I click refresh 30 times, the empeg has 30 network connections in use.
When I finish a bit of cleanup, I'll release the source... nothing fancy, just a quick hack without any comments.