Have been needing to write some code that recognises (and captures) when there's incoming/outgoing smb transfers on my server. I think the best way is to use popen with 'iftop'.
I was thinking I could just use popen to capture the data, but thing is iftop doesn't simply output the data - its an interactive environment that runs continuously until the user exits. So how can I parse values from these kind of programs into python?
Alternatively - a better option that popen(iftop) ?
Example:
foo.Popen("iftop" + someArguments)
//this is not stdout, so I can't pull string values (etc) from it :(
//how does?