Reads the byte counter on the last rule in a chain (from the 'filter' or other specified table) on Unix box using iptables as a firewall.
If the following rules were entered on a Linux box with iptables setup then the script could be used to read values for the data to and from 192.168.100.19. The idea is simple, direct output that you want to measure to a custom chain and add an accept rule to the chain.
#iptables -N testin
#iptables -N testout
#iptables -A OUTPUT -d 192.168.100.19 -j testout
#iptables -A INPUT -s 192.168.100.19 -j testin
#iptables -A testin -j ACCEPT
#iptables -A testout -j ACCEPT