an arm device, not has iptables, have a bussiness process, need to count all traffic bytes of this process.
my solution:
- get socket id,
ls -lh /proc/pid/fd
- get port by socket id,
/proc/net/tcp
- get nf_conntrack info,
cat /proc/net/nf_conntrack | grep port
- count bytes
if my collection frequency is 1 minute, i warry some connection info will be clear by system in 1 minute, that will reduce the accuracy of collection.
what i can do to ensure the accuracy of collection? help to give some advices, thanks a lot
New contributor
zhao yang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.